Update pom.xml file for part of main project

This commit is contained in:
YuCheng Hu 2025-04-30 14:18:30 -04:00
parent e9811c372a
commit c6a8551a8c
Signed by: honeymoose
GPG Key ID: D74AE0B33A8002EC
5 changed files with 9 additions and 4 deletions

1
.idea/compiler.xml generated
View File

@ -40,6 +40,7 @@
<module name="jackson-custom-conversions" /> <module name="jackson-custom-conversions" />
<module name="core-java-collections-conversions-2" /> <module name="core-java-collections-conversions-2" />
<module name="jackson-exceptions" /> <module name="jackson-exceptions" />
<module name="xstream" />
<module name="apache-httpclient" /> <module name="apache-httpclient" />
<module name="core-java-8" /> <module name="core-java-8" />
<module name="core-java-collections-3" /> <module name="core-java-collections-3" />

2
.idea/encodings.xml generated
View File

@ -96,5 +96,7 @@
<file url="file://$PROJECT_DIR$/xml-2/src/main/resources" charset="UTF-8" /> <file url="file://$PROJECT_DIR$/xml-2/src/main/resources" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/xml/src/main/java" charset="UTF-8" /> <file url="file://$PROJECT_DIR$/xml/src/main/java" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/xml/src/main/resources" charset="UTF-8" /> <file url="file://$PROJECT_DIR$/xml/src/main/resources" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/xstream/src/main/java" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/xstream/src/main/resources" charset="UTF-8" />
</component> </component>
</project> </project>

View File

@ -56,6 +56,7 @@
<module>toolkits</module> <module>toolkits</module>
<module>xml</module> <module>xml</module>
<module>xml-2</module> <module>xml-2</module>
<module>xstream</module>
</modules> </modules>
<properties> <properties>

View File

@ -10,9 +10,9 @@
<description>An Introduction To XStream</description> <description>An Introduction To XStream</description>
<parent> <parent>
<groupId>com.baeldung</groupId> <groupId>com.ossez</groupId>
<artifactId>parent-modules</artifactId> <artifactId>parent-modules</artifactId>
<version>1.0.0-SNAPSHOT</version> <version>0.0.2-SNAPSHOT</version>
</parent> </parent>
<dependencies> <dependencies>

View File

@ -9,6 +9,7 @@ import java.io.InputStream;
import java.io.OutputStream; import java.io.OutputStream;
import java.net.HttpURLConnection; import java.net.HttpURLConnection;
import java.net.SocketException; import java.net.SocketException;
import java.net.URI;
import java.net.URL; import java.net.URL;
import static org.junit.Assert.assertTrue; import static org.junit.Assert.assertTrue;
@ -43,9 +44,9 @@ public final class AppUnitTest {
* side-effect that is difficult to observe. * side-effect that is difficult to observe.
*/ */
@Test(expected = SocketException.class) @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 // 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(); final HttpURLConnection connection = (HttpURLConnection) url.openConnection();
connection.setRequestMethod("POST"); connection.setRequestMethod("POST");
connection.setDoOutput(true); connection.setDoOutput(true);