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