use of org.jboss.eap.additional.testsuite.annotations.ATTest in project eap-additional-testsuite by jboss-set.
the class SecurityDeserializationTestCase method testSecuirtyDatabind4.
@ATTest({ "modules/testcases/jdkAll/Wildfly/security/src/main/java#16.0.0.Beta1", "modules/testcases/jdkAll/WildflyRelease-17.0.0.Final/security/src/main/java", "modules/testcases/jdkAll/Eap71x-Proposed/security/src/main/java#7.1.6", "modules/testcases/jdkAll/Eap71x/security/src/main/java#7.1.6", "modules/testcases/jdkAll/Eap72x-Proposed/security/src/main/java#7.2.1", "modules/testcases/jdkAll/Eap72x/security/src/main/java#7.2.1" })
@Test
public void testSecuirtyDatabind4() throws Exception {
final String JSON = aposToQuotes("{'v':['org.apache.axis2.jaxws.spi.handler.HandlerResolverImpl','/tmp/foobar.txt']}");
ObjectMapper mapper = new ObjectMapper();
mapper.enableDefaultTyping();
try {
PolyWrapper sc = mapper.readValue(JSON, PolyWrapper.class);
fail("Should not be able to deserialize because of security prevention.");
} catch (JsonMappingException e) {
assertTrue("Fail because of security issues...", e.getMessage().contains("prevented for security reasons"));
}
}
use of org.jboss.eap.additional.testsuite.annotations.ATTest in project eap-additional-testsuite by jboss-set.
the class SecurityDeserializationTestCase method testSecuirtyDatabind8.
@ATTest({ "modules/testcases/jdkAll/Wildfly/security/src/main/java#17.0.0.Beta1", "modules/testcases/jdkAll/Eap72x-Proposed/security/src/main/java#7.2.1", "modules/testcases/jdkAll/Eap72x/security/src/main/java#7.2.1" })
public void testSecuirtyDatabind8() throws Exception {
final String JSON = aposToQuotes("{'v':['oracle.jdbc.connector.OracleManagedConnectionFactory']}");
ObjectMapper mapper = new ObjectMapper();
mapper.enableDefaultTyping();
try {
PolyWrapper sc = mapper.readValue(JSON, PolyWrapper.class);
fail("Should not be able to deserialize because of security prevention.");
} catch (JsonMappingException e) {
assertTrue("Fail because of security issues...", e.getMessage().contains("prevented for security reasons"));
}
}
use of org.jboss.eap.additional.testsuite.annotations.ATTest in project eap-additional-testsuite by jboss-set.
the class SecurityDeserializationTestCase method testSecuirtyDatabind2.
@ATTest({ "modules/testcases/jdkAll/Wildfly/security/src/main/java", "modules/testcases/jdkAll/WildflyRelease-17.0.0.Final/security/src/main/java", "modules/testcases/jdkAll/Eap72x/security/src/main/java", "modules/testcases/jdkAll/Eap72x-Proposed/security/src/main/java", "modules/testcases/jdkAll/Eap7/security/src/main/java", "modules/testcases/jdkAll/Eap72x-Proposed/security/src/main/java", "modules/testcases/jdkAll/Eap72x/security/src/main/java", "modules/testcases/jdkAll/Eap71x-Proposed/security/src/main/java", "modules/testcases/jdkAll/Eap71x/security/src/main/java" })
@Test
public void testSecuirtyDatabind2() throws Exception {
final String JSON = aposToQuotes("{'v':['java.util.logging.FileHandler','/tmp/foobar.txt']}");
ObjectMapper mapper = new ObjectMapper();
mapper.enableDefaultTyping();
try {
PolyWrapper sc = mapper.readValue(JSON, PolyWrapper.class);
fail("Should not be able to deserialize because of security prevention.");
} catch (JsonMappingException e) {
assertTrue("Fail because of security issues...", e.getMessage().contains("prevented for security reasons"));
}
}
Aggregations