use of ca.corefacility.bioinformatics.irida.model.workflow.submission.AnalysisSubmission in project irida by phac-nml.
the class AnalysisSubmissionServiceImplIT method testUpdateAdminUser.
/**
* Tests updating the analysis as the admin user.
*/
@Test
@WithMockUser(username = "aaron", roles = "ADMIN")
public void testUpdateAdminUser() {
AnalysisSubmission submission = analysisSubmissionService.read(1L);
submission.setAnalysisState(AnalysisState.COMPLETED);
assertNotNull("submission should be updated", analysisSubmissionService.update(submission));
}
use of ca.corefacility.bioinformatics.irida.model.workflow.submission.AnalysisSubmission in project irida by phac-nml.
the class AnalysisSubmissionServiceImplIT method testReadSharedAnalysis.
/**
* Tests whether a user can read an analysis when they are not the submitter
* but they are on a project where the analysis is shared
*/
@Test
@WithMockUser(username = "otheraaron", roles = "USER")
public void testReadSharedAnalysis() {
AnalysisSubmission read = analysisSubmissionService.read(3L);
assertEquals("id should be 3", new Long(3), read.getId());
}
use of ca.corefacility.bioinformatics.irida.model.workflow.submission.AnalysisSubmission in project irida by phac-nml.
the class AnalysisSubmissionServiceImplIT method shareAnalysisSubmissionWithProjectFail.
@Test(expected = AccessDeniedException.class)
@WithMockUser(username = "otheraaron", roles = "USER")
public void shareAnalysisSubmissionWithProjectFail() {
AnalysisSubmission read = analysisSubmissionService.read(3L);
Project project2 = projectService.read(2L);
analysisSubmissionService.shareAnalysisSubmissionWithProject(read, project2);
}
use of ca.corefacility.bioinformatics.irida.model.workflow.submission.AnalysisSubmission in project irida by phac-nml.
the class AnalysisSubmissionServiceImplIT method testRemoveAnalysisSubmissionFromProjectFail.
@Test(expected = AccessDeniedException.class)
@WithMockUser(username = "otheraaron", roles = "USER")
public void testRemoveAnalysisSubmissionFromProjectFail() {
AnalysisSubmission read = analysisSubmissionService.read(3L);
Project project2 = projectService.read(1L);
analysisSubmissionService.removeAnalysisProjectShare(read, project2);
}
use of ca.corefacility.bioinformatics.irida.model.workflow.submission.AnalysisSubmission in project irida by phac-nml.
the class AnalysisSubmissionServiceImplIT method testCreateRegularUser.
/**
* Tests creating a submission as a regular user.
*/
@Test
@WithMockUser(username = "aaron", roles = "USER")
public void testCreateRegularUser() {
SingleEndSequenceFile sequencingObject = (SingleEndSequenceFile) sequencingObjectRepository.findOne(1L);
AnalysisSubmission submission = AnalysisSubmission.builder(workflowId).name("test").inputFiles(Sets.newHashSet(sequencingObject)).build();
AnalysisSubmission createdSubmission = analysisSubmissionService.create(submission);
assertNotNull("Submission should have been created", createdSubmission);
assertEquals("submitter should be set properly", Long.valueOf(1L), createdSubmission.getSubmitter().getId());
}
Aggregations