Search in sources :

Example 1 with AnalysisUpdateDTO

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

the class AnalysisControllerTests method testUpdateAnalysisType.

@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-type-updating.xml", assertionMode = NON_STRICT) })
public void testUpdateAnalysisType() throws Exception {
    AnalysisUpdateDTO analysisDTO = new AnalysisUpdateDTO();
    analysisDTO.setTypeId(CommonAnalysisType.COHORT_CHARACTERIZATION.name());
    testUpdate(analysisDTO, UPDATED_ANALYSIS_TYPE_JSON_OBJECT, "Cohort Characterization");
}
Also used : AnalysisUpdateDTO(com.odysseusinc.arachne.portal.api.v1.dto.AnalysisUpdateDTO) DatabaseSetups(com.github.springtestdbunit.annotation.DatabaseSetups) Test(org.junit.Test) WithUserDetails(org.springframework.security.test.context.support.WithUserDetails) ExpectedDatabases(com.github.springtestdbunit.annotation.ExpectedDatabases)

Example 2 with AnalysisUpdateDTO

use of com.odysseusinc.arachne.portal.api.v1.dto.AnalysisUpdateDTO 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);
}
Also used : AnalysisUpdateDTO(com.odysseusinc.arachne.portal.api.v1.dto.AnalysisUpdateDTO) DatabaseSetups(com.github.springtestdbunit.annotation.DatabaseSetups) Test(org.junit.Test) WithUserDetails(org.springframework.security.test.context.support.WithUserDetails) ExpectedDatabases(com.github.springtestdbunit.annotation.ExpectedDatabases)

Example 3 with AnalysisUpdateDTO

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

the class AnalysisControllerTests method testUpdateAnalysisDescription.

@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-description-updating.xml", assertionMode = NON_STRICT) })
public void testUpdateAnalysisDescription() throws Exception {
    AnalysisUpdateDTO analysisDTO = new AnalysisUpdateDTO();
    analysisDTO.setDescription(UPDATED_ANALYSIS_DESCRIPTION_VALUE);
    analysisDTO.setTypeId(ANALYSIS_TYPE_ID);
    testUpdate(analysisDTO, UPDATED_ANALYSIS_DESCR_JSON_OBJECT, null);
}
Also used : AnalysisUpdateDTO(com.odysseusinc.arachne.portal.api.v1.dto.AnalysisUpdateDTO) DatabaseSetups(com.github.springtestdbunit.annotation.DatabaseSetups) Test(org.junit.Test) WithUserDetails(org.springframework.security.test.context.support.WithUserDetails) ExpectedDatabases(com.github.springtestdbunit.annotation.ExpectedDatabases)

Aggregations

DatabaseSetups (com.github.springtestdbunit.annotation.DatabaseSetups)3 ExpectedDatabases (com.github.springtestdbunit.annotation.ExpectedDatabases)3 AnalysisUpdateDTO (com.odysseusinc.arachne.portal.api.v1.dto.AnalysisUpdateDTO)3 Test (org.junit.Test)3 WithUserDetails (org.springframework.security.test.context.support.WithUserDetails)3