use of com.odysseusinc.arachne.portal.api.v1.dto.AnalysisDTO in project ArachneCentralAPI by OHDSI.
the class AnalysisControllerTests method testUpdateAnalysisTitle.
@Test
@WithUserDetails(value = ADMIN_EMAIL)
@DatabaseSetups({ @DatabaseSetup("/data/study-with-contributor.xml"), @DatabaseSetup("/data/analysis/analysis-before-updating.xml") })
@ExpectedDatabases({ @ExpectedDatabase(value = "/data/study-with-contributor.xml", assertionMode = NON_STRICT), @ExpectedDatabase(value = "/data/analysis/analysis-after-title-updating.xml", assertionMode = NON_STRICT) })
public void testUpdateAnalysisTitle() throws Exception {
AnalysisUpdateDTO analysisDTO = new AnalysisUpdateDTO();
analysisDTO.setTitle(UPDATED_ANALYSIS_TITLE);
analysisDTO.setTypeId(ANALYSIS_TYPE_ID);
testUpdate(analysisDTO, UPDATED_ANALYSIS_JSON_OBJECT, UPDATED_ANALYSIS_TITLE);
}
use of com.odysseusinc.arachne.portal.api.v1.dto.AnalysisDTO 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);
}
use of com.odysseusinc.arachne.portal.api.v1.dto.AnalysisDTO in project ArachneCentralAPI by OHDSI.
the class BaseAnalysisToAnalysisDTOConverter method convert.
@Override
public AD convert(A source) {
BaseAnalysisDTO baseAnalysisDTO = conversionService.convert(source, BaseAnalysisDTO.class);
AD analysisDTO = createResultObject();
converterUtils.shallowCopy(analysisDTO, baseAnalysisDTO);
analysisDTO.setStudy(conversionService.convert(source.getStudy(), StudyShortDTO.class));
if (source.getFiles() != null) {
for (AnalysisFile analysisFile : source.getFiles()) {
analysisDTO.getFiles().add(conversionService.convert(analysisFile, AnalysisFileDTO.class));
}
}
analysisDTO.setPermissions(conversionService.convert(source, PermissionsDTO.class));
analysisDTO.setLocked(source.getLocked());
return analysisDTO;
}
use of com.odysseusinc.arachne.portal.api.v1.dto.AnalysisDTO in project ArachneCentralAPI by OHDSI.
the class SubmissionInsightToSubmissionInsightDTOConverter method analysisConverter.
private AnalysisDTO analysisConverter(final Analysis analysis) {
final AnalysisDTO analysisDTO = new AnalysisDTO();
analysisDTO.setId(analysis.getId());
analysisDTO.setTitle(analysis.getTitle());
final StudyShortDTO studyDTO = new StudyShortDTO();
final Study study = analysis.getStudy();
studyDTO.setId(study.getId());
studyDTO.setTitle(study.getTitle());
analysisDTO.setStudy(studyDTO);
return analysisDTO;
}
Aggregations