use of io.dropwizard.jersey.validation.ValidationErrorMessage in project API by ca-cwds.
the class StaffPersonResourceTest method createDelegatesToResourceDelegate.
/**
* Create Tests
*
* @throws Exception required for test compilation
*/
@Test
public void createDelegatesToResourceDelegate() throws Exception {
StaffPerson staffperson = new StaffPerson("1969-01-01", "Bart", "Student", "Simpson", "Q", "", new BigDecimal(9165551212L), 124, "1969-01-01", "", true, "abcdefghij", "description", "id", "03", false, "1234567890", "emailaddy");
final Response resp = inMemoryResource.client().target(ROOT_RESOURCE).request().accept(MediaType.APPLICATION_JSON).post(Entity.entity(staffperson, MediaType.APPLICATION_JSON));
ValidationErrorMessage msg = resp.readEntity(ValidationErrorMessage.class);
if (msg != null) {
final List<String> errors = msg.getErrors();
if (errors != null && errors.size() > 0) {
for (String err : errors) {
System.out.println("ERROR: " + err);
}
}
}
verify(resourceDelegate).create(eq(staffperson));
}
Aggregations