List of usage examples for org.springframework.util Assert doesNotContain
@Deprecated public static void doesNotContain(@Nullable String textToSearch, String substring)
From source file:com.epam.jaxb.XMLExternalEntityExpansionTest.java
@Test public void testXXEAttackProtection() throws IOException { final Response response = wsSecuredRequestBuilder.grantClientCredentials().path("/sample/dto").build() .accept(MediaType.APPLICATION_XML) .post(Entity.xml("<!DOCTYPE user[<!ENTITY xxe SYSTEM \"" + xxeFile.getAbsolutePath() + "\" >]><sampleWSDTO><value>value &xxe;</value></sampleWSDTO>")); if (response.getStatus() == HttpStatus.SC_CREATED) { final String wsdto = response.readEntity(String.class); Assert.doesNotContain(wsdto, "xxeAttackSuccessful"); } else {//from ww w. j av a 2 s . c o m WebservicesAssert.assertResponse(Status.BAD_REQUEST, response); } }