use of org.hisp.dhis.webapi.snippets.SomeUserId in project dhis2-core by dhis2.
the class AbstractCrudControllerTest method testPartialUpdateObject_Validation.
@Test
void testPartialUpdateObject_Validation() {
String id = run(SomeUserId::new);
JsonError error = PATCH("/users/" + id + "?importReportMode=ERRORS", "[{'op': 'add', 'path': '/email', 'value': 'Not-valid'}]").error();
assertEquals("Property `email` requires a valid email address, was given `Not-valid`.", error.getTypeReport().getErrorReports().get(0).getMessage());
}
use of org.hisp.dhis.webapi.snippets.SomeUserId in project dhis2-core by dhis2.
the class AbstractCrudControllerTest method testGetObject.
@Test
void testGetObject() {
String id = run(SomeUserId::new);
JsonUser userById = GET("/users/{id}", id).content(HttpStatus.OK).as(JsonUser.class);
assertTrue(userById.exists());
assertEquals(id, userById.getId());
}
Aggregations