use of com.odysseusinc.arachne.portal.api.v1.dto.AnalysisCreateDTO in project ArachneCentralAPI by OHDSI.
the class AnalysisControllerTests method testCreateAnalysis.
@Test
@WithUserDetails(value = ADMIN_EMAIL)
@DatabaseSetups({ @DatabaseSetup("/data/study-with-contributor.xml"), @DatabaseSetup("/data/analysis/empty-analysis.xml") })
@ExpectedDatabases({ @ExpectedDatabase(value = "/data/study-with-contributor.xml", assertionMode = NON_STRICT), @ExpectedDatabase(value = "/data/analysis/analysis.xml", assertionMode = NON_STRICT) })
public void testCreateAnalysis() throws Exception {
AnalysisCreateDTO analysisDTO = new AnalysisCreateDTO();
analysisDTO.setTitle(ANALYSIS_TITLE);
analysisDTO.setTypeId(ANALYSIS_TYPE_ID);
analysisDTO.setStudyId(STUDY_ID);
MvcResult mvcResult = mvc.perform(post("/api/v1/analysis-management/analyses").contentType(APPLICATION_JSON).content(objectMapper.writeValueAsBytes(analysisDTO))).andExpect(OK_STATUS).andExpect(NO_ERROR_CODE).andExpect(jsonPath("$.result.id").isNotEmpty()).andReturn();
JSONObject result = getResultJSONObject(mvcResult);
JSONAssert.assertEquals(ANALYSIS_JSON_OBJECT, result, false);
}
Aggregations