use of ca.corefacility.bioinformatics.irida.model.run.MiseqRun in project irida by phac-nml.
the class SequencingRunControllerTest method testGetFilesPage.
@SuppressWarnings("rawtypes")
@Test
public void testGetFilesPage() throws IOException {
Long runId = 1L;
ExtendedModelMap model = new ExtendedModelMap();
SequencingRun sequencingRunEntity = new MiseqRun(SequencingRun.LayoutType.PAIRED_END, "");
ImmutableSet<SequencingObject> files = ImmutableSet.of(new SingleEndSequenceFile(new SequenceFile()));
when(sequencingRunService.read(runId)).thenReturn(sequencingRunEntity);
when(objectService.getSequencingObjectsForSequencingRun(sequencingRunEntity)).thenReturn(files);
String filesPage = controller.getFilesPage(runId, model);
assertEquals(SequencingRunController.FILES_VIEW, filesPage);
assertFalse(((Collection) model.get("sequencingObjects")).isEmpty());
assertEquals(sequencingRunEntity, model.get("run"));
assertTrue(model.containsKey("fileCount"));
verify(sequencingRunService).read(runId);
verify(objectService).getSequencingObjectsForSequencingRun(sequencingRunEntity);
}
use of ca.corefacility.bioinformatics.irida.model.run.MiseqRun in project irida by phac-nml.
the class SequencingRunServiceImplIT method testCreateMiseqRunAsUser.
@Test
@WithMockUser(username = "user", password = "password1", roles = "USER")
public void testCreateMiseqRunAsUser() {
MiseqRun mr = new MiseqRun(LayoutType.PAIRED_END, "workflow");
SequencingRun create = miseqRunService.create(mr);
assertEquals("user", create.getUser().getUsername());
}
use of ca.corefacility.bioinformatics.irida.model.run.MiseqRun in project irida by phac-nml.
the class SequencingObjectServiceTest method testCreateSequenceFileInSampleWrongType.
@Test(expected = IllegalArgumentException.class)
public void testCreateSequenceFileInSampleWrongType() throws IOException {
Sample s = new Sample();
SingleEndSequenceFile so = TestDataFactory.constructSingleEndSequenceFile();
SequencingRun run = new MiseqRun(LayoutType.PAIRED_END, "workflow");
so.setSequencingRun(run);
when(repository.save(so)).thenReturn(so);
service.createSequencingObjectInSample(so, s);
}
use of ca.corefacility.bioinformatics.irida.model.run.MiseqRun in project irida by phac-nml.
the class SequencingObjectServiceTest method testCreateSequenceFilePairInSampleWrongType.
@Test(expected = IllegalArgumentException.class)
public void testCreateSequenceFilePairInSampleWrongType() throws IOException {
Sample s = new Sample();
SequencingRun run = new MiseqRun(LayoutType.SINGLE_END, "workflow");
SequenceFilePair so = TestDataFactory.constructSequenceFilePair();
so.setSequencingRun(run);
when(repository.save(so)).thenReturn(so);
service.createSequencingObjectInSample(so, s);
}
Aggregations