|
24 | 24 | import java.util.logging.Logger; |
25 | 25 |
|
26 | 26 | import com.cedarsoftware.io.JsonIo; |
| 27 | +import com.cedarsoftware.io.TypeHolder; |
27 | 28 | import org.junit.jupiter.api.Test; |
28 | 29 | import org.junit.jupiter.api.condition.EnabledIfSystemProperty; |
29 | 30 |
|
@@ -3562,7 +3563,7 @@ public void testStringKeysWithResolvedValues() { |
3562 | 3563 |
|
3563 | 3564 | // Serialize and deserialize |
3564 | 3565 | String json = JsonIo.toJson(map, null); |
3565 | | - CompactMap<String, Object> restoredMap = JsonIo.toObjects(json, null, CompactMap.class); |
| 3566 | + CompactMap<String, Object> restoredMap = JsonIo.toJava(json, null).asClass(CompactMap.class); |
3566 | 3567 |
|
3567 | 3568 | // Verify the map was properly restored |
3568 | 3569 | assertEquals(3, restoredMap.size()); |
@@ -3606,7 +3607,7 @@ public void testNonStringKeysWithSimpleValues() { |
3606 | 3607 |
|
3607 | 3608 | // Serialize and deserialize |
3608 | 3609 | String json = JsonIo.toJson(map, null); |
3609 | | - CompactMap<Object, String> restoredMap = JsonIo.toObjects(json, null, CompactMap.class); |
| 3610 | + CompactMap<Object, String> restoredMap = JsonIo.toJava(json, null).asClass(CompactMap.class); |
3610 | 3611 |
|
3611 | 3612 | // Verify the map was properly restored |
3612 | 3613 | assertEquals(3, restoredMap.size()); |
@@ -3663,7 +3664,7 @@ public void testNonStringKeysAndValuesWithResolution() { |
3663 | 3664 | // Serialize and deserialize |
3664 | 3665 | String json = JsonIo.toJson(map, null); |
3665 | 3666 | LOG.info("JSON: " + json); |
3666 | | - CompactMap<Object, Object> restoredMap = JsonIo.toObjects(json, null, CompactMap.class); |
| 3667 | + CompactMap<Object, Object> restoredMap = JsonIo.toJava(json, null).asClass(CompactMap.class); |
3667 | 3668 |
|
3668 | 3669 | // Verify map size |
3669 | 3670 | assertEquals(4, restoredMap.size(), "Map should have 4 entries"); |
@@ -3735,7 +3736,7 @@ public void testCircularReferencesWithNonStringKeys() { |
3735 | 3736 | // Serialize and deserialize |
3736 | 3737 | String json = JsonIo.toJson(map, null); |
3737 | 3738 | LOG.info("Circular reference JSON: " + json); |
3738 | | - CompactMap<Object, Object> restoredMap = JsonIo.toObjects(json, null, CompactMap.class); |
| 3739 | + CompactMap<Object, Object> restoredMap = JsonIo.toJava(json, null).asClass(CompactMap.class); |
3739 | 3740 |
|
3740 | 3741 | // Get reference objects |
3741 | 3742 | Person personFromMarker = (Person) restoredMap.get("personKey"); |
@@ -3815,7 +3816,7 @@ public void testReferenceHandling() { |
3815 | 3816 |
|
3816 | 3817 | // Serialize and deserialize |
3817 | 3818 | String json = JsonIo.toJson(map, null); |
3818 | | - CompactMap<Object, Object> restoredMap = JsonIo.toObjects(json, null, CompactMap.class); |
| 3819 | + CompactMap<Object, Object> restoredMap = JsonIo.toJava(json, null).asClass(CompactMap.class); |
3819 | 3820 |
|
3820 | 3821 | // Get reference objects |
3821 | 3822 | Person personFromMarker = (Person) restoredMap.get("personKey"); |
|
0 commit comments