BAEL-3067: Changed method name and added latest maven dependency of org.json

This commit is contained in:
Vikas Ramsingh Rajput 2020-05-26 12:59:40 +03:00
parent 05a4d4e188
commit 11d0ab1b49
2 changed files with 3 additions and 3 deletions

View File

@ -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>

View File

@ -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));