diff --git a/aws-modules/aws-dynamodb/pom.xml b/aws-modules/aws-dynamodb/pom.xml
index 37b88327f4..adce036733 100644
--- a/aws-modules/aws-dynamodb/pom.xml
+++ b/aws-modules/aws-dynamodb/pom.xml
@@ -79,7 +79,7 @@
- 2.8.0
+ 2.10.1
1.21.1
3.1.1
diff --git a/aws-modules/aws-miscellaneous/pom.xml b/aws-modules/aws-miscellaneous/pom.xml
index 4126256fb9..5fdd7fa04d 100644
--- a/aws-modules/aws-miscellaneous/pom.xml
+++ b/aws-modules/aws-miscellaneous/pom.xml
@@ -73,7 +73,7 @@
- 2.8.0
+ 2.10.1
1.21.1
1.10.L001
0.9.4.0006L
diff --git a/java-websocket/pom.xml b/java-websocket/pom.xml
index d529b32022..fd97fd9db3 100644
--- a/java-websocket/pom.xml
+++ b/java-websocket/pom.xml
@@ -29,7 +29,7 @@
1.1
- 2.8.0
+ 2.10.1
\ No newline at end of file
diff --git a/json-modules/gson/pom.xml b/json-modules/gson/pom.xml
index ecfbaa7be4..ba968d9ae1 100644
--- a/json-modules/gson/pom.xml
+++ b/json-modules/gson/pom.xml
@@ -64,7 +64,7 @@
- 2.8.0
+ 2.10.1
2.9.6
diff --git a/json-modules/gson/src/test/java/com/baeldung/gson/conversion/JsonObjectConversionsUnitTest.java b/json-modules/gson/src/test/java/com/baeldung/gson/conversion/JsonObjectConversionsUnitTest.java
index 9f07617969..18d9ccaf06 100644
--- a/json-modules/gson/src/test/java/com/baeldung/gson/conversion/JsonObjectConversionsUnitTest.java
+++ b/json-modules/gson/src/test/java/com/baeldung/gson/conversion/JsonObjectConversionsUnitTest.java
@@ -1,7 +1,9 @@
package com.baeldung.gson.conversion;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertTrue;
+
import com.google.gson.*;
-import org.junit.Assert;
import org.junit.jupiter.api.Test;
public class JsonObjectConversionsUnitTest {
@@ -10,24 +12,29 @@ public class JsonObjectConversionsUnitTest {
void whenUsingJsonParser_thenConvertToJsonObject() throws Exception {
// Example 1: Using JsonParser
String json = "{ \"name\": \"Baeldung\", \"java\": true }";
-
- JsonObject jsonObject = new JsonParser().parse(json).getAsJsonObject();
-
- Assert.assertTrue(jsonObject.isJsonObject());
- Assert.assertTrue(jsonObject.get("name").getAsString().equals("Baeldung"));
- Assert.assertTrue(jsonObject.get("java").getAsBoolean() == true);
+
+ JsonObject jsonObject = JsonParser.parseString(json)
+ .getAsJsonObject();
+
+ assertTrue(jsonObject.isJsonObject());
+ assertEquals("Baeldung", jsonObject.get("name")
+ .getAsString());
+ assertTrue(jsonObject.get("java")
+ .getAsBoolean());
}
@Test
void whenUsingGsonInstanceFromJson_thenConvertToJsonObject() throws Exception {
// Example 2: Using fromJson
String json = "{ \"name\": \"Baeldung\", \"java\": true }";
-
+
JsonObject convertedObject = new Gson().fromJson(json, JsonObject.class);
-
- Assert.assertTrue(convertedObject.isJsonObject());
- Assert.assertTrue(convertedObject.get("name").getAsString().equals("Baeldung"));
- Assert.assertTrue(convertedObject.get("java").getAsBoolean() == true);
+
+ assertTrue(convertedObject.isJsonObject());
+ assertEquals("Baeldung", convertedObject.get("name")
+ .getAsString());
+ assertTrue(convertedObject.get("java")
+ .getAsBoolean());
}
}
diff --git a/json-modules/json-arrays/pom.xml b/json-modules/json-arrays/pom.xml
index 10c487fbda..ec492b49cc 100644
--- a/json-modules/json-arrays/pom.xml
+++ b/json-modules/json-arrays/pom.xml
@@ -38,7 +38,7 @@
1.0
- 2.8.5
+ 2.10.1
1.1.2
2.28.0
diff --git a/json-modules/json/pom.xml b/json-modules/json/pom.xml
index 27c9262279..ba075be679 100644
--- a/json-modules/json/pom.xml
+++ b/json-modules/json/pom.xml
@@ -68,7 +68,7 @@
1.0.72
1.0
1.0.1
- 2.8.5
+ 2.10.1
1.1.2
2.28.0
diff --git a/libraries-data-io/pom.xml b/libraries-data-io/pom.xml
index 2e126610d4..0a8afa02e2 100644
--- a/libraries-data-io/pom.xml
+++ b/libraries-data-io/pom.xml
@@ -106,7 +106,7 @@
v4-rev493-1.21.0
6.1.2
2.3.1
- 2.8.7
+ 2.10.1
1.15
0.14.2
3.17.3
diff --git a/libraries-data/pom.xml b/libraries-data/pom.xml
index a721e967d2..85ef01e704 100644
--- a/libraries-data/pom.xml
+++ b/libraries-data/pom.xml
@@ -210,7 +210,7 @@
3.3.1
2.14.0
2.9.1
- 2.9.1
+ 2.10.1
1.1.1
1.5.0
5.2.0
diff --git a/libraries-http-2/pom.xml b/libraries-http-2/pom.xml
index fa3b6534db..c80c5729a7 100644
--- a/libraries-http-2/pom.xml
+++ b/libraries-http-2/pom.xml
@@ -110,7 +110,7 @@
4.9.1
- 2.8.5
+ 2.10.1
4.9.1
1.0.3
9.4.19.v20190610
diff --git a/libraries-http/pom.xml b/libraries-http/pom.xml
index 18ba571f60..c726b56b5d 100644
--- a/libraries-http/pom.xml
+++ b/libraries-http/pom.xml
@@ -103,7 +103,7 @@
- 2.8.5
+ 2.10.1
4.5.3
4.9.1
1.23.0
diff --git a/web-modules/javax-servlets/pom.xml b/web-modules/javax-servlets/pom.xml
index 80a1e3af9f..406cfc05c1 100644
--- a/web-modules/javax-servlets/pom.xml
+++ b/web-modules/javax-servlets/pom.xml
@@ -49,7 +49,7 @@
4.5.3
- 2.8.2
+ 2.10.1
\ No newline at end of file
diff --git a/web-modules/spark-java/pom.xml b/web-modules/spark-java/pom.xml
index da09467212..e49be68319 100644
--- a/web-modules/spark-java/pom.xml
+++ b/web-modules/spark-java/pom.xml
@@ -30,7 +30,7 @@
2.5.4
- 2.8.0
+ 2.10.1
\ No newline at end of file