use of com.odysseusinc.arachne.portal.api.v1.dto.ApproveDTO in project ArachneCentralAPI by OHDSI.
the class AnalysisSubmissionControllerTests method testDeclineSubmissionByOwner.
@Test
@WithUserDetails(DATA_NODE_ONWER)
@DatabaseSetups({ @DatabaseSetup("/data/analysis/submission/submission-pending.xml") })
@ExpectedDatabases({ @ExpectedDatabase(value = "/data/analysis/submission/result/submission-datasource2-declined.xml", assertionMode = NON_STRICT) })
public void testDeclineSubmissionByOwner() throws Exception {
ApproveDTO approveDTO = new ApproveDTO(SUBMISSION_ID, false, null, "comment");
prepareAnalysisFile(STUDY_ID, ANALYSIS_ID);
prepareSubmissionGroupFile(STUDY_ID, ANALYSIS_ID, SUBMISSION_GROUP_ID);
mvc.perform(post("/api/v1/analysis-management/submissions/{submissionId}/approve", 1).contentType(APPLICATION_JSON).content(objectMapper.writeValueAsBytes(approveDTO))).andExpect(NO_ERROR_CODE);
}
use of com.odysseusinc.arachne.portal.api.v1.dto.ApproveDTO in project ArachneCentralAPI by OHDSI.
the class AnalysisSubmissionControllerTests method testDeclineSubmissionResultByNonOwner.
@Test
@WithUserDetails(DATA_NODE_USER)
@DatabaseSetups({ @DatabaseSetup("/data/analysis/submission/submission-executed.xml") })
@ExpectedDatabase(value = "/data/analysis/submission/submission-executed.xml", assertionMode = NON_STRICT)
public void testDeclineSubmissionResultByNonOwner() throws Exception {
ApproveDTO approveDTO = new ApproveDTO(SUBMISSION_ID, false, null, "comment");
prepareAnalysisFile(STUDY_ID, ANALYSIS_ID);
prepareSubmissionGroupFile(STUDY_ID, ANALYSIS_ID, SUBMISSION_GROUP_ID);
mvc.perform(post("/api/v1/analysis-management/submissions/{submissionId}/approveresult", 1).contentType(APPLICATION_JSON).content(objectMapper.writeValueAsBytes(approveDTO))).andExpect(PERMISSION_DENIED_CODE);
}
use of com.odysseusinc.arachne.portal.api.v1.dto.ApproveDTO in project ArachneCentralAPI by OHDSI.
the class AnalysisSubmissionControllerTests method testDeclineSubmissionResultByOwner.
@Test
@WithUserDetails(DATA_NODE_ONWER)
@DatabaseSetups({ @DatabaseSetup("/data/analysis/submission/submission-executed.xml") })
@ExpectedDatabase(value = "/data/analysis/submission/result/submission-datasource2-result-declined.xml", assertionMode = NON_STRICT)
public void testDeclineSubmissionResultByOwner() throws Exception {
ApproveDTO approveDTO = new ApproveDTO(SUBMISSION_ID, false, null, "comment");
prepareAnalysisFile(STUDY_ID, ANALYSIS_ID);
prepareSubmissionGroupFile(STUDY_ID, ANALYSIS_ID, SUBMISSION_GROUP_ID);
mvc.perform(post("/api/v1/analysis-management/submissions/{submissionId}/approveresult", 1).contentType(APPLICATION_JSON).content(objectMapper.writeValueAsBytes(approveDTO))).andExpect(NO_ERROR_CODE);
}
use of com.odysseusinc.arachne.portal.api.v1.dto.ApproveDTO in project ArachneCentralAPI by OHDSI.
the class AnalysisSubmissionControllerTests method testDeclineSubmissionByNonOwner.
@Test
@WithUserDetails(DATA_NODE_USER)
@DatabaseSetups({ @DatabaseSetup("/data/analysis/submission/submission-pending.xml") })
@ExpectedDatabase(value = "/data/analysis/submission/submission-pending.xml", assertionMode = NON_STRICT)
public void testDeclineSubmissionByNonOwner() throws Exception {
ApproveDTO approveDTO = new ApproveDTO(SUBMISSION_ID, false, null, "comment");
prepareAnalysisFile(STUDY_ID, ANALYSIS_ID);
prepareSubmissionGroupFile(STUDY_ID, ANALYSIS_ID, SUBMISSION_GROUP_ID);
mvc.perform(post("/api/v1/analysis-management/submissions/{submissionId}/approve", 1).contentType(APPLICATION_JSON).content(objectMapper.writeValueAsBytes(approveDTO))).andExpect(PERMISSION_DENIED_CODE);
}
use of com.odysseusinc.arachne.portal.api.v1.dto.ApproveDTO in project ArachneCentralAPI by OHDSI.
the class AnalysisSubmissionControllerTests method testApproveSubmissionByOwner.
@Test
@WithUserDetails(DATA_NODE_ONWER)
@DatabaseSetups({ @DatabaseSetup("/data/analysis/submission/submission-pending.xml") })
@ExpectedDatabases({ @ExpectedDatabase(value = "/data/analysis/submission/result/submission-datasource2-approved.xml", assertionMode = NON_STRICT) })
public void testApproveSubmissionByOwner() throws Exception {
ApproveDTO approveDTO = new ApproveDTO(SUBMISSION_ID, true, null, "string");
prepareAnalysisFile(STUDY_ID, ANALYSIS_ID);
prepareSubmissionGroupFile(STUDY_ID, ANALYSIS_ID, SUBMISSION_GROUP_ID);
mvc.perform(post("/api/v1/analysis-management/submissions/{submissionId}/approve", 1).contentType(APPLICATION_JSON).content(objectMapper.writeValueAsBytes(approveDTO))).andExpect(NO_ERROR_CODE);
}
Aggregations