Search in sources :

Example 1 with PartialExample

use of io.dropwizard.jersey.jackson.JacksonMessageBodyProviderTest.PartialExample in project dropwizard by dropwizard.

the class ConstraintViolationExceptionMapperTest method returnPartialBothValidatedRequestEntities.

@Test
public void returnPartialBothValidatedRequestEntities() {
    final Response response = target("/valid/validatedPartialExampleBoth").request().post(Entity.json("{\"id\":1,\"text\":\"hello Cemo\"}"));
    assertThat(response.getStatus()).isEqualTo(200);
    PartialExample ex = response.readEntity(PartialExample.class);
    assertThat(ex.id).isEqualTo(1);
    assertThat(ex.text).isEqualTo("hello Cemo");
}
Also used : Response(javax.ws.rs.core.Response) PartialExample(io.dropwizard.jersey.jackson.JacksonMessageBodyProviderTest.PartialExample) AbstractJerseyTest(io.dropwizard.jersey.AbstractJerseyTest) Test(org.junit.Test)

Aggregations

AbstractJerseyTest (io.dropwizard.jersey.AbstractJerseyTest)1 PartialExample (io.dropwizard.jersey.jackson.JacksonMessageBodyProviderTest.PartialExample)1 Response (javax.ws.rs.core.Response)1 Test (org.junit.Test)1