BAEL-3067: Changed method name and added latest maven dependency of org.json
This commit is contained in:
parent
05a4d4e188
commit
11d0ab1b49
|
@ -25,7 +25,7 @@
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.json</groupId>
|
<groupId>org.json</groupId>
|
||||||
<artifactId>json</artifactId>
|
<artifactId>json</artifactId>
|
||||||
<version>20190722</version>
|
<version>20200518</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
|
|
|
@ -17,7 +17,7 @@ import org.junit.Test;
|
||||||
public class JavaBufferedReaderToJSONObjectUnitTest {
|
public class JavaBufferedReaderToJSONObjectUnitTest {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void givenUsingNewVersion_whenConvertBufferedReaderToJSONObject_thenCorrect() {
|
public void givenValidJson_whenUsingBufferedReader_thenJSONTokenerConverts() {
|
||||||
byte[] b = "{ \"name\" : \"John\", \"age\" : 18 }".getBytes(StandardCharsets.UTF_8);
|
byte[] b = "{ \"name\" : \"John\", \"age\" : 18 }".getBytes(StandardCharsets.UTF_8);
|
||||||
InputStream is = new ByteArrayInputStream(b);
|
InputStream is = new ByteArrayInputStream(b);
|
||||||
BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(is));
|
BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(is));
|
||||||
|
@ -30,7 +30,7 @@ public class JavaBufferedReaderToJSONObjectUnitTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void givenUsingOldVersion_whenConvertBufferedReaderToJSONObject_thenCorrect() throws IOException {
|
public void givenValidJson_whenUsingString_thenJSONObjectConverts() throws IOException {
|
||||||
byte[] b = "{ \"name\" : \"John\", \"age\" : 18 }".getBytes(StandardCharsets.UTF_8);
|
byte[] b = "{ \"name\" : \"John\", \"age\" : 18 }".getBytes(StandardCharsets.UTF_8);
|
||||||
InputStream is = new ByteArrayInputStream(b);
|
InputStream is = new ByteArrayInputStream(b);
|
||||||
BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(is));
|
BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(is));
|
||||||
|
|
Loading…
Reference in New Issue