Example usage for org.springframework.util Assert doesNotContain

List of usage examples for org.springframework.util Assert doesNotContain

Introduction

In this page you can find the example usage for org.springframework.util Assert doesNotContain.

Prototype

@Deprecated
public static void doesNotContain(@Nullable String textToSearch, String substring) 

Source Link

Document

Assert that the given text does not contain the given substring.

Usage

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);
    }

}