Search in sources :

Example 1 with BogusPointcutAdvisor

use of org.springframework.jacksontest.BogusPointcutAdvisor in project eap-additional-testsuite by jboss-set.

the class JaxbProviderDeserializationSecurityCheck1TestCase method testPointcutAdvisor.

@Test
@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;" })
public // @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;"})
void testPointcutAdvisor() throws Exception {
    String result = performCall("rest/jaxb/advisor");
    try {
        BogusPointcutAdvisor jaxbModel = new ObjectMapper().configure(SerializationFeature.FAIL_ON_EMPTY_BEANS, false).readValue(result, BogusPointcutAdvisor.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"));
    }
}
Also used : BogusPointcutAdvisor(org.springframework.jacksontest.BogusPointcutAdvisor) JsonMappingException(com.fasterxml.jackson.databind.JsonMappingException) ObjectMapper(com.fasterxml.jackson.databind.ObjectMapper) EATDPM(org.jboss.eap.additional.testsuite.annotations.EATDPM) Test(org.junit.Test)

Example 2 with BogusPointcutAdvisor

use of org.springframework.jacksontest.BogusPointcutAdvisor in project eap-additional-testsuite by jboss-set.

the class JaxbProviderDeserializationSecurityCheckTestCase method testPointcutAdvisor.

@Test
@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;" })
public // @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;"})
void testPointcutAdvisor() throws Exception {
    String result = performCall("rest/jaxb/advisor");
    try {
        BogusPointcutAdvisor jaxbModel = new ObjectMapper().configure(SerializationFeature.FAIL_ON_EMPTY_BEANS, false).readValue(result, BogusPointcutAdvisor.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"));
    }
}
Also used : BogusPointcutAdvisor(org.springframework.jacksontest.BogusPointcutAdvisor) JsonMappingException(com.fasterxml.jackson.databind.JsonMappingException) ObjectMapper(com.fasterxml.jackson.databind.ObjectMapper) EATDPM(org.jboss.eap.additional.testsuite.annotations.EATDPM) ATTest(org.jboss.eap.additional.testsuite.annotations.ATTest) Test(org.junit.Test)

Aggregations

JsonMappingException (com.fasterxml.jackson.databind.JsonMappingException)2 ObjectMapper (com.fasterxml.jackson.databind.ObjectMapper)2 EATDPM (org.jboss.eap.additional.testsuite.annotations.EATDPM)2 Test (org.junit.Test)2 BogusPointcutAdvisor (org.springframework.jacksontest.BogusPointcutAdvisor)2 ATTest (org.jboss.eap.additional.testsuite.annotations.ATTest)1