Search in sources :

Example 1 with AnalysisLockDTO

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

the class AnalysisLockingControllerTests method testLockAnalysis.

@Test
@WithUserDetails(value = ADMIN_EMAIL)
@DatabaseSetups({ @DatabaseSetup("/data/users.xml"), @DatabaseSetup("/data/study-with-contributor.xml"), @DatabaseSetup("/data/analysis/analysis-list.xml") })
@ExpectedDatabases({ @ExpectedDatabase(value = "/data/users.xml", assertionMode = NON_STRICT), @ExpectedDatabase(value = "/data/study-with-contributor.xml", assertionMode = NON_STRICT), @ExpectedDatabase(value = "/data/analysis/analysis-after-locking.xml", assertionMode = NON_STRICT) })
public void testLockAnalysis() throws Exception {
    AnalysisLockDTO lockFileDTO = new AnalysisLockDTO();
    lockFileDTO.setLocked(TRUE);
    mvc.perform(post("/api/v1/analysis-management/analyses/{analysisId}/lock", ANALYSIS_ID).contentType(APPLICATION_JSON).content(objectMapper.writeValueAsBytes(lockFileDTO))).andExpect(NO_ERROR_CODE);
}
Also used : AnalysisLockDTO(com.odysseusinc.arachne.portal.api.v1.dto.AnalysisLockDTO) 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)1 ExpectedDatabases (com.github.springtestdbunit.annotation.ExpectedDatabases)1 AnalysisLockDTO (com.odysseusinc.arachne.portal.api.v1.dto.AnalysisLockDTO)1 Test (org.junit.Test)1 WithUserDetails (org.springframework.security.test.context.support.WithUserDetails)1