|
|
@ -1,13 +1,10 @@ |
|
|
|
import org.junit.jupiter.api.BeforeAll; |
|
|
|
import org.junit.jupiter.api.Test; |
|
|
|
|
|
|
|
import java.io.BufferedReader; |
|
|
|
import java.io.IOException; |
|
|
|
import java.io.InputStream; |
|
|
|
import java.io.InputStreamReader; |
|
|
|
import java.io.*; |
|
|
|
import java.nio.charset.StandardCharsets; |
|
|
|
|
|
|
|
import static org.junit.jupiter.api.Assertions.assertThrowsExactly; |
|
|
|
import static org.junit.jupiter.api.Assertions.assertTrue; |
|
|
|
import static org.junit.jupiter.api.Assertions.*; |
|
|
|
|
|
|
|
class ResourceApiTest { |
|
|
|
|
|
|
@ -36,4 +33,11 @@ class ResourceApiTest { |
|
|
|
|
|
|
|
assertTrue(response.toString().contains("Alleinherrschaft")); |
|
|
|
} |
|
|
|
|
|
|
|
@Test |
|
|
|
void getStringFromInputStream() throws IOException { |
|
|
|
String testString = "I am a test string!\nAnother test line.\n"; |
|
|
|
InputStream is = new ByteArrayInputStream(testString.getBytes(StandardCharsets.UTF_8)); |
|
|
|
assertEquals(resourceApi.getStringFromInputStream(is), testString); |
|
|
|
} |
|
|
|
} |