use of com.odysseusinc.arachne.portal.api.v1.dto.CreateStudyDTO in project ArachneCentralAPI by OHDSI.
the class StudyControllerTests method testCreateStudy.
@Test
@WithUserDetails(value = ADMIN_EMAIL)
@DatabaseSetup("/data/user/admin-user.xml")
@ExpectedDatabases({ @ExpectedDatabase(value = "/data/study/study.xml", assertionMode = NON_STRICT) })
public void testCreateStudy() throws Exception {
CreateStudyDTO studyDTO = new CreateStudyDTO();
studyDTO.setTypeId(STUDY_TYPE_ID);
studyDTO.setTitle(STUDY_TITLE);
MvcResult mvcResult = mvc.perform(post("/api/v1/study-management/studies/").contentType(APPLICATION_JSON).content(objectMapper.writeValueAsBytes(studyDTO))).andExpect(jsonPath("$.result.id").isNotEmpty()).andExpect(NO_ERROR_CODE).andExpect(OK_STATUS).andReturn();
JSONObject result = getResultJSONObject(mvcResult);
JSONAssert.assertEquals(STUDY_JSON_OBJECT, result, false);
}
Aggregations