Update code for xml-2

This commit is contained in:
YuCheng Hu
2025-04-29 08:22:24 -04:00
parent b13d0c4d9c
commit bcbd0bbd49
3 changed files with 5 additions and 3 deletions
@@ -7,6 +7,7 @@ import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertThat;
import java.io.File;
import java.net.URI;
import java.net.URL;
import java.util.List;
import java.util.Map;
@@ -103,7 +104,7 @@ public class JavaReadWriteJsonExampleUnitTest {
@Test
public void wheReadFromUrl_thanCorrect() throws Exception {
URL resource = new URL("file:src/test/resources/json_car.json");
URL resource = new URI("file:src/test/resources/json_car.json").toURL();
ObjectMapper objectMapper = new ObjectMapper();
Car fromFile = objectMapper.readValue(resource, Car.class);