Search in sources :

Example 11 with StudyStatusDTO

use of com.odysseusinc.arachne.portal.api.v1.dto.dictionary.StudyStatusDTO in project ArachneCentralAPI by OHDSI.

the class StudyControllerTests method testUpdateStudyDescription.

@Test
@WithUserDetails(value = ADMIN_EMAIL)
@DatabaseSetup("/data/study/study-before-updating.xml")
@ExpectedDatabases({ @ExpectedDatabase(value = "/data/study/study-after-updating-description.xml", assertionMode = NON_STRICT) })
public void testUpdateStudyDescription() throws Exception {
    StudyDTO updatedStudyDTO = new StudyDTO();
    updatedStudyDTO.setId(STUDY_ID);
    updatedStudyDTO.setDescription(UPDATED_DESCRIPTION);
    StudyStatusDTO status = new StudyStatusDTO(STUDY_STATUS_ID, "Initiate");
    updatedStudyDTO.setStatus(status);
    testUpdate(updatedStudyDTO, UPDATED_STUDY_JSON_OBJECT, null);
}
Also used : CreateStudyDTO(com.odysseusinc.arachne.portal.api.v1.dto.CreateStudyDTO) StudyDTO(com.odysseusinc.arachne.portal.api.v1.dto.StudyDTO) StudyStatusDTO(com.odysseusinc.arachne.portal.api.v1.dto.dictionary.StudyStatusDTO) Test(org.junit.Test) WithUserDetails(org.springframework.security.test.context.support.WithUserDetails) ExpectedDatabases(com.github.springtestdbunit.annotation.ExpectedDatabases) DatabaseSetup(com.github.springtestdbunit.annotation.DatabaseSetup)

Aggregations

StudyStatusDTO (com.odysseusinc.arachne.portal.api.v1.dto.dictionary.StudyStatusDTO)11 DatabaseSetup (com.github.springtestdbunit.annotation.DatabaseSetup)6 ExpectedDatabases (com.github.springtestdbunit.annotation.ExpectedDatabases)6 CreateStudyDTO (com.odysseusinc.arachne.portal.api.v1.dto.CreateStudyDTO)6 StudyDTO (com.odysseusinc.arachne.portal.api.v1.dto.StudyDTO)6 Test (org.junit.Test)6 WithUserDetails (org.springframework.security.test.context.support.WithUserDetails)6 StudyStatus (com.odysseusinc.arachne.portal.model.StudyStatus)5 CreateStudyStatusDTO (com.odysseusinc.arachne.portal.api.v1.dto.dictionary.CreateStudyStatusDTO)4 ApiOperation (io.swagger.annotations.ApiOperation)4 RequestMapping (org.springframework.web.bind.annotation.RequestMapping)4 StudyTypeDTO (com.odysseusinc.arachne.portal.api.v1.dto.dictionary.StudyTypeDTO)3 FieldError (org.springframework.validation.FieldError)2 JsonResult (com.odysseusinc.arachne.commons.api.v1.dto.util.JsonResult)1 BaseConversionServiceAwareConverter (com.odysseusinc.arachne.portal.api.v1.dto.converters.BaseConversionServiceAwareConverter)1 StudyState (com.odysseusinc.arachne.portal.model.statemachine.study.StudyState)1 Arrays (java.util.Arrays)1 LinkedList (java.util.LinkedList)1 List (java.util.List)1 Component (org.springframework.stereotype.Component)1