Search in sources :

Example 16 with SequencingRun

use of ca.corefacility.bioinformatics.irida.model.run.SequencingRun in project irida by phac-nml.

the class SequencingRunServiceImplIT method testDeleteMiseqRunAsTechFail.

@Test(expected = AccessDeniedException.class)
@WithMockUser(username = "tech", password = "password1", roles = "TECHNICIAN")
public void testDeleteMiseqRunAsTechFail() {
    // run 2 is not owned by "user"
    SequencingRun mr = miseqRunService.read(2L);
    miseqRunService.delete(mr.getId());
}
Also used : SequencingRun(ca.corefacility.bioinformatics.irida.model.run.SequencingRun) WithMockUser(org.springframework.security.test.context.support.WithMockUser) Test(org.junit.Test)

Example 17 with SequencingRun

use of ca.corefacility.bioinformatics.irida.model.run.SequencingRun in project irida by phac-nml.

the class SequencingRunServiceImplIT method testUpdateMiseqRunAsSequencer.

@Test
@WithMockUser(username = "sequencer", password = "password1", roles = "SEQUENCER")
public void testUpdateMiseqRunAsSequencer() {
    String newDescription = "a different description";
    SequencingRun mr = miseqRunService.read(1L);
    mr.setDescription(newDescription);
    SequencingRun update = miseqRunService.update(mr);
    assertEquals(update.getDescription(), newDescription);
}
Also used : SequencingRun(ca.corefacility.bioinformatics.irida.model.run.SequencingRun) WithMockUser(org.springframework.security.test.context.support.WithMockUser) Test(org.junit.Test)

Example 18 with SequencingRun

use of ca.corefacility.bioinformatics.irida.model.run.SequencingRun in project irida by phac-nml.

the class SequencingRunServiceImplIT method testUpdateMiseqRunAsTechFail.

@Test(expected = AccessDeniedException.class)
@WithMockUser(username = "tech", password = "password1", roles = "TECHNICIAN")
public void testUpdateMiseqRunAsTechFail() {
    // run 2 is not owned by "user"
    SequencingRun mr = miseqRunService.read(2L);
    mr.setDescription("different description");
    miseqRunService.update(mr);
}
Also used : SequencingRun(ca.corefacility.bioinformatics.irida.model.run.SequencingRun) WithMockUser(org.springframework.security.test.context.support.WithMockUser) Test(org.junit.Test)

Example 19 with SequencingRun

use of ca.corefacility.bioinformatics.irida.model.run.SequencingRun in project irida by phac-nml.

the class SequencingRunServiceImplIT method testReadMiseqRunAsSequencer.

@Test
@WithMockUser(username = "sequencer", password = "password1", roles = "SEQUENCER")
public void testReadMiseqRunAsSequencer() {
    SequencingRun mr = miseqRunService.read(1L);
    assertNotNull("Created run was not assigned an ID.", mr.getId());
}
Also used : SequencingRun(ca.corefacility.bioinformatics.irida.model.run.SequencingRun) WithMockUser(org.springframework.security.test.context.support.WithMockUser) Test(org.junit.Test)

Example 20 with SequencingRun

use of ca.corefacility.bioinformatics.irida.model.run.SequencingRun in project irida by phac-nml.

the class SequencingRunServiceImplIT method testUpdateMiseqRunAsUserSuccess.

@Test
@WithMockUser(username = "user", password = "password1", roles = "USER")
public void testUpdateMiseqRunAsUserSuccess() {
    // run 1 is owned by "user" so should be able to update
    SequencingRun mr = miseqRunService.read(1L);
    mr.setDescription("different description");
    miseqRunService.update(mr);
}
Also used : SequencingRun(ca.corefacility.bioinformatics.irida.model.run.SequencingRun) WithMockUser(org.springframework.security.test.context.support.WithMockUser) Test(org.junit.Test)

Aggregations

SequencingRun (ca.corefacility.bioinformatics.irida.model.run.SequencingRun)25 Test (org.junit.Test)17 WithMockUser (org.springframework.security.test.context.support.WithMockUser)13 SingleEndSequenceFile (ca.corefacility.bioinformatics.irida.model.sequenceFile.SingleEndSequenceFile)9 Sample (ca.corefacility.bioinformatics.irida.model.sample.Sample)8 SequenceFile (ca.corefacility.bioinformatics.irida.model.sequenceFile.SequenceFile)8 SequencingObject (ca.corefacility.bioinformatics.irida.model.sequenceFile.SequencingObject)8 MiseqRun (ca.corefacility.bioinformatics.irida.model.run.MiseqRun)7 Path (java.nio.file.Path)6 PreAuthorize (org.springframework.security.access.prepost.PreAuthorize)4 RequestMapping (org.springframework.web.bind.annotation.RequestMapping)4 SampleSequencingObjectJoin (ca.corefacility.bioinformatics.irida.model.sample.SampleSequencingObjectJoin)3 SequenceFilePair (ca.corefacility.bioinformatics.irida.model.sequenceFile.SequenceFilePair)3 ModelMap (org.springframework.ui.ModelMap)3 EntityNotFoundException (ca.corefacility.bioinformatics.irida.exceptions.EntityNotFoundException)2 CoverageQCEntry (ca.corefacility.bioinformatics.irida.model.sample.CoverageQCEntry)2 FileProcessorErrorQCEntry (ca.corefacility.bioinformatics.irida.model.sample.FileProcessorErrorQCEntry)2 QCEntry (ca.corefacility.bioinformatics.irida.model.sample.QCEntry)2 User (ca.corefacility.bioinformatics.irida.model.user.User)2 AnalysisFastQC (ca.corefacility.bioinformatics.irida.model.workflow.analysis.AnalysisFastQC)2