diff --git a/.idea/compiler.xml b/.idea/compiler.xml index c5cdf5038d..7d6d2ebcd2 100644 --- a/.idea/compiler.xml +++ b/.idea/compiler.xml @@ -40,6 +40,7 @@ + diff --git a/.idea/encodings.xml b/.idea/encodings.xml index e2602f3cfc..f8feab6f94 100644 --- a/.idea/encodings.xml +++ b/.idea/encodings.xml @@ -96,5 +96,7 @@ + + \ No newline at end of file diff --git a/pom.xml b/pom.xml index d721685dae..e2d58f5205 100644 --- a/pom.xml +++ b/pom.xml @@ -56,6 +56,7 @@ toolkits xml xml-2 + xstream diff --git a/xstream/pom.xml b/xstream/pom.xml index 6f25e67e12..8f14d1c833 100644 --- a/xstream/pom.xml +++ b/xstream/pom.xml @@ -10,9 +10,9 @@ An Introduction To XStream - com.baeldung + com.ossez parent-modules - 1.0.0-SNAPSHOT + 0.0.2-SNAPSHOT diff --git a/xstream/src/test/java/com/baeldung/rce/AppUnitTest.java b/xstream/src/test/java/com/baeldung/rce/AppUnitTest.java index 3b541ae099..19d9b60463 100644 --- a/xstream/src/test/java/com/baeldung/rce/AppUnitTest.java +++ b/xstream/src/test/java/com/baeldung/rce/AppUnitTest.java @@ -9,6 +9,7 @@ import java.io.InputStream; import java.io.OutputStream; import java.net.HttpURLConnection; import java.net.SocketException; +import java.net.URI; import java.net.URL; import static org.junit.Assert.assertTrue; @@ -43,9 +44,9 @@ public final class AppUnitTest { * side-effect that is difficult to observe. */ @Test(expected = SocketException.class) - public void givenAppIsVulneable_whenExecuteRemoteCodeWhichThrowsException_thenThrowsException() throws IOException { + public void givenAppIsVulneable_whenExecuteRemoteCodeWhichThrowsException_thenThrowsException() throws Exception { // POST the attack.xml to the application's /persons endpoint - final URL url = new URL("http://localhost:" + app.port() + "/persons"); + final URL url = new URI("http://localhost:" + app.port() + "/persons").toURL(); final HttpURLConnection connection = (HttpURLConnection) url.openConnection(); connection.setRequestMethod("POST"); connection.setDoOutput(true);