use of org.apache.ibatis.datasource.jndi.JndiDataSourceFactory in project eap-additional-testsuite by jboss-set.
the class JaxbProviderDeserializationSecurityCheck6TestCase method testMyBatisJndiDataSourceFactory.
@Test
public void testMyBatisJndiDataSourceFactory() throws Exception {
String result = performCall("rest/jaxb/datasource");
try {
JndiDataSourceFactory jaxbModel = new ObjectMapper().configure(SerializationFeature.FAIL_ON_EMPTY_BEANS, false).readValue(result, JndiDataSourceFactory.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.apache.ibatis.datasource.jndi.JndiDataSourceFactory in project eap-additional-testsuite by jboss-set.
the class JaxbProviderDeserializationSecurityCheckTestCase method testMyBatisJndiDataSourceFactory.
@ATTest({ "modules/testcases/jdkAll/Wildfly/jaxrs/src/main/java#13.0.0", "modules/testcases/jdkAll/WildflyRelease-17.0.0.Final/jaxrs/src/main/java", "modules/testcases/jdkAll/Eap71x/jaxrs/src/main/java#7.1.2", "modules/testcases/jdkAll/Eap71x-Proposed/jaxrs/src/main/java#7.1.2", "modules/testcases/jdkAll/Eap7/jaxrs/src/main/java#7.1.2", "modules/testcases/jdkAll/Eap72x/jaxrs/src/main/java", "modules/testcases/jdkAll/Eap72x-Proposed/jaxrs/src/main/java" })
@Test
public void testMyBatisJndiDataSourceFactory() throws Exception {
String result = performCall("rest/jaxb/datasource");
try {
JndiDataSourceFactory jaxbModel = new ObjectMapper().configure(SerializationFeature.FAIL_ON_EMPTY_BEANS, false).readValue(result, JndiDataSourceFactory.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