use of com.github.springtestdbunit.annotation.ExpectedDatabase in project ArachneCentralAPI by OHDSI.
the class UserControllerTests method testUpdate.
@Test
@WithUserDetails(value = ADMIN_EMAIL)
@DatabaseSetup("/data/user/admin-user.xml")
@ExpectedDatabase(value = "/data/user/updated-admin-user.xml", assertionMode = NON_STRICT)
public void testUpdate() throws Exception {
UserProfileGeneralDTO dto = getUserProfileGeneralDTO();
MvcResult mvcResult = mvc.perform(post("/api/v1/user-management/users/profile").contentType(APPLICATION_JSON).content(objectMapper.writeValueAsBytes(dto))).andExpect(NO_ERROR_CODE).andExpect(OK_STATUS).andReturn();
JSONObject general = getGeneral(mvcResult);
JSONAssert.assertEquals(UPDATED_USER_JSON_OBJECT, general, false);
Assert.assertEquals(PROFESSIONAL_TYPE_ID.intValue(), general.getJSONObject("professionalType").get("id"));
}
Aggregations