use of org.springframework.jacksontest.BogusApplicationContext in project eap-additional-testsuite by jboss-set.
the class JaxbProviderDeserializationSecurityCheckTestCase method testApplicationContext.
@EATDPM(config = "standalone.xml", features = { "org.wildfly:wildfly-feature-pack-new#jaxrs:subsystem=jaxrs" }, minVersions = { "13.0.0" }, maxVersions = { "null" }, isClassAnnotation = "false", excludeDependencies = { "javax.ws.rs.GET;" })
// @EATDPM(config="standalone.xml", features={"org.wildfly:wildfly-feature-pack-new#subsystem.jaxrs:subsystem=jaxrs"}, minVersions={"13.0.0"}, maxVersions={"null"}, isClassAnnotation="false", excludeDependencies={"javax.ws.rs.GET;"})
@Test
public void testApplicationContext() throws Exception {
String result = performCall("rest/jaxb/appcontext");
try {
BogusApplicationContext jaxbModel = new ObjectMapper().configure(SerializationFeature.FAIL_ON_EMPTY_BEANS, false).readValue(result, BogusApplicationContext.class);
Assert.fail("Should prevente json deserialization because of security reasons.");
} catch (JsonMappingException e) {
Assert.assertTrue("Should prevente json deserialization because of security reasons.", e.getMessage().contains("Illegal type"));
}
}
use of org.springframework.jacksontest.BogusApplicationContext in project eap-additional-testsuite by jboss-set.
the class JaxbProviderDeserializationSecurityCheck2TestCase method testApplicationContext.
@EATDPM(config = "standalone.xml", features = { "org.wildfly:wildfly-feature-pack-new#jaxrs:subsystem=jaxrs" }, minVersions = { "13.0.0" }, maxVersions = { "null" }, isClassAnnotation = "false", excludeDependencies = { "javax.ws.rs.GET;" })
// @EATDPM(config="standalone.xml", features={"org.wildfly:wildfly-feature-pack-new#subsystem.jaxrs:subsystem=jaxrs"}, minVersions={"13.0.0"}, maxVersions={"null"}, isClassAnnotation="false", excludeDependencies={"javax.ws.rs.GET;"})
@Test
public void testApplicationContext() throws Exception {
String result = performCall("rest/jaxb/appcontext");
try {
BogusApplicationContext jaxbModel = new ObjectMapper().configure(SerializationFeature.FAIL_ON_EMPTY_BEANS, false).readValue(result, BogusApplicationContext.class);
Assert.fail("Should prevente json deserialization because of security reasons.");
} catch (JsonMappingException e) {
Assert.assertTrue("Should prevente json deserialization because of security reasons.", e.getMessage().contains("Illegal type"));
}
}
Aggregations