use of com.odysseusinc.arachne.portal.api.v1.dto.dictionary.StudyTypeDTO in project ArachneCentralAPI by OHDSI.
the class StudyTypeControllerTests method testUpdateStudyType.
@Test
@DatabaseSetup("/data/study/type/study-type-before-updating.xml")
@ExpectedDatabase(value = "/data/study/type/study-type-after-updating.xml", assertionMode = NON_STRICT)
public void testUpdateStudyType() throws Exception {
StudyTypeDTO dto = new StudyTypeDTO(ID);
dto.setName(UPDATED_NAME);
MvcResult mvcResult = mvc.perform(put("/api/v1/admin/study-types/" + ID).contentType(APPLICATION_JSON).content(objectMapper.writeValueAsBytes(dto))).andExpect(jsonPath("$.result.id").isNotEmpty()).andExpect(OK_STATUS).andReturn();
JSONAssert.assertEquals(UPDATED_STUDY_TYPE_JSON_OBJECT, getResultJSONObject(mvcResult), false);
}
Aggregations