Search in sources :

Example 16 with StudyDTO

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

the class StudyControllerTests method testUpdateStudyStatus.

@Test
@WithUserDetails(value = ADMIN_EMAIL)
@DatabaseSetup("/data/study/study-before-updating.xml")
@ExpectedDatabases({ @ExpectedDatabase(value = "/data/study/study-after-updating-status.xml", assertionMode = NON_STRICT_UNORDERED) })
public void testUpdateStudyStatus() throws Exception {
    StudyDTO updatedStudyDTO = new StudyDTO();
    updatedStudyDTO.setId(STUDY_ID);
    updatedStudyDTO.setDescription("description");
    StudyTypeDTO type = new StudyTypeDTO(STUDY_TYPE_ID);
    type.setName("type1");
    updatedStudyDTO.setType(type);
    StudyStatusDTO status = new StudyStatusDTO(2L, "Active");
    updatedStudyDTO.setStatus(status);
    testUpdate(updatedStudyDTO, UPDATED_STUDY_STATUS_JSON_OBJECT, "Active");
}
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) StudyTypeDTO(com.odysseusinc.arachne.portal.api.v1.dto.dictionary.StudyTypeDTO) Test(org.junit.Test) WithUserDetails(org.springframework.security.test.context.support.WithUserDetails) ExpectedDatabases(com.github.springtestdbunit.annotation.ExpectedDatabases) DatabaseSetup(com.github.springtestdbunit.annotation.DatabaseSetup)

Example 17 with StudyDTO

use of com.odysseusinc.arachne.portal.api.v1.dto.StudyDTO 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)10 StudyDTO (com.odysseusinc.arachne.portal.api.v1.dto.StudyDTO)9 CreateStudyDTO (com.odysseusinc.arachne.portal.api.v1.dto.CreateStudyDTO)8 Study (com.odysseusinc.arachne.portal.model.Study)8 DatabaseSetup (com.github.springtestdbunit.annotation.DatabaseSetup)7 ExpectedDatabases (com.github.springtestdbunit.annotation.ExpectedDatabases)7 Test (org.junit.Test)7 WithUserDetails (org.springframework.security.test.context.support.WithUserDetails)7 StudyTypeDTO (com.odysseusinc.arachne.portal.api.v1.dto.dictionary.StudyTypeDTO)6 PermissionsDTO (com.odysseusinc.arachne.portal.api.v1.dto.PermissionsDTO)4 StudyMediumDTO (com.odysseusinc.arachne.portal.api.v1.dto.StudyMediumDTO)3 IUser (com.odysseusinc.arachne.portal.model.IUser)3 List (java.util.List)3 DataSourceDTO (com.odysseusinc.arachne.portal.api.v1.dto.DataSourceDTO)2 ParticipantDTO (com.odysseusinc.arachne.portal.api.v1.dto.ParticipantDTO)2 ShortUserDTO (com.odysseusinc.arachne.portal.api.v1.dto.ShortUserDTO)2 StudyListDTO (com.odysseusinc.arachne.portal.api.v1.dto.StudyListDTO)2 StudyShortDTO (com.odysseusinc.arachne.portal.api.v1.dto.StudyShortDTO)2 BaseConversionServiceAwareConverter (com.odysseusinc.arachne.portal.api.v1.dto.converters.BaseConversionServiceAwareConverter)2 StudyDataSourceLink (com.odysseusinc.arachne.portal.model.StudyDataSourceLink)2