Search in sources :

Example 1 with RunStore

use of uk.ac.bbsrc.tgac.miso.persistence.RunStore in project miso-lims by miso-lims.

the class DefaultRunServiceTest method testProcessNotificationNoChange.

@Test
public void testProcessNotificationNoChange() throws Exception {
    Run notificationRun = makeRun();
    Predicate<SequencingParameters> filterParameters = (params) -> false;
    GetLaneContents getLaneContents = (lane) -> Optional.empty();
    assertFalse(sut.processNotification(notificationRun, 1, CONTAINER_MODEL_BARCODE, CONTAINER_SERIAL_NO, SEQUENCER_NAME, filterParameters, getLaneContents, null));
    Mockito.verify(runStore, Mockito.times(0)).save(Mockito.any());
}
Also used : User(com.eaglegenomics.simlims.core.User) SequencingContainerModel(uk.ac.bbsrc.tgac.miso.core.data.impl.SequencingContainerModel) Arrays(java.util.Arrays) AuthorizationManager(uk.ac.bbsrc.tgac.miso.core.security.AuthorizationManager) RunStore(uk.ac.bbsrc.tgac.miso.persistence.RunStore) Date(java.util.Date) Mock(org.mockito.Mock) LocalDateTime(java.time.LocalDateTime) KitDescriptorService(uk.ac.bbsrc.tgac.miso.core.service.KitDescriptorService) HealthType(uk.ac.bbsrc.tgac.miso.core.data.type.HealthType) RunPartition(uk.ac.bbsrc.tgac.miso.core.data.RunPartition) InstrumentDataManglingPolicy(uk.ac.bbsrc.tgac.miso.core.data.InstrumentDataManglingPolicy) SequencingContainerModelService(uk.ac.bbsrc.tgac.miso.core.service.SequencingContainerModelService) IlluminaRun(uk.ac.bbsrc.tgac.miso.core.data.IlluminaRun) InstrumentType(uk.ac.bbsrc.tgac.miso.core.data.type.InstrumentType) UserService(uk.ac.bbsrc.tgac.miso.core.service.UserService) MockitoAnnotations(org.mockito.MockitoAnnotations) ChangeLog(uk.ac.bbsrc.tgac.miso.core.data.ChangeLog) UserImpl(uk.ac.bbsrc.tgac.miso.core.data.impl.UserImpl) Run(uk.ac.bbsrc.tgac.miso.core.data.Run) GetLaneContents(uk.ac.bbsrc.tgac.miso.core.data.GetLaneContents) SequencerPartitionContainer(uk.ac.bbsrc.tgac.miso.core.data.SequencerPartitionContainer) SequencerPartitionContainerImpl(uk.ac.bbsrc.tgac.miso.core.data.impl.SequencerPartitionContainerImpl) ContainerService(uk.ac.bbsrc.tgac.miso.core.service.ContainerService) ZoneOffset(java.time.ZoneOffset) InstrumentImpl(uk.ac.bbsrc.tgac.miso.core.data.impl.InstrumentImpl) RunPartitionService(uk.ac.bbsrc.tgac.miso.core.service.RunPartitionService) ValidationError(uk.ac.bbsrc.tgac.miso.core.service.exception.ValidationError) Before(org.junit.Before) InjectMocks(org.mockito.InjectMocks) ValidationException(uk.ac.bbsrc.tgac.miso.core.service.exception.ValidationException) Predicate(java.util.function.Predicate) IOException(java.io.IOException) Test(org.junit.Test) SequencingParameters(uk.ac.bbsrc.tgac.miso.core.data.SequencingParameters) Partition(uk.ac.bbsrc.tgac.miso.core.data.Partition) Mockito(org.mockito.Mockito) RunPosition(uk.ac.bbsrc.tgac.miso.core.data.impl.RunPosition) SequencingParametersService(uk.ac.bbsrc.tgac.miso.core.service.SequencingParametersService) InstrumentService(uk.ac.bbsrc.tgac.miso.core.service.InstrumentService) Assert.assertFalse(org.junit.Assert.assertFalse) PoolService(uk.ac.bbsrc.tgac.miso.core.service.PoolService) Optional(java.util.Optional) PlatformType(uk.ac.bbsrc.tgac.miso.core.data.type.PlatformType) Instrument(uk.ac.bbsrc.tgac.miso.core.data.Instrument) InstrumentModel(uk.ac.bbsrc.tgac.miso.core.data.InstrumentModel) SequencingParameters(uk.ac.bbsrc.tgac.miso.core.data.SequencingParameters) IlluminaRun(uk.ac.bbsrc.tgac.miso.core.data.IlluminaRun) Run(uk.ac.bbsrc.tgac.miso.core.data.Run) GetLaneContents(uk.ac.bbsrc.tgac.miso.core.data.GetLaneContents) Test(org.junit.Test)

Example 2 with RunStore

use of uk.ac.bbsrc.tgac.miso.persistence.RunStore in project miso-lims by miso-lims.

the class DefaultRunServiceTest method testProcessNotificationDontOverwriteUserHealth.

@Test
public void testProcessNotificationDontOverwriteUserHealth() throws Exception {
    Run notificationRun = makeRun();
    notificationRun.setHealth(HealthType.Running);
    Predicate<SequencingParameters> filterParameters = (params) -> false;
    GetLaneContents getLaneContents = (lane) -> Optional.empty();
    assertFalse(sut.processNotification(notificationRun, 1, CONTAINER_MODEL_BARCODE, CONTAINER_SERIAL_NO, SEQUENCER_NAME, filterParameters, getLaneContents, null));
    Mockito.verify(runStore, Mockito.times(0)).save(Mockito.any());
}
Also used : User(com.eaglegenomics.simlims.core.User) SequencingContainerModel(uk.ac.bbsrc.tgac.miso.core.data.impl.SequencingContainerModel) Arrays(java.util.Arrays) AuthorizationManager(uk.ac.bbsrc.tgac.miso.core.security.AuthorizationManager) RunStore(uk.ac.bbsrc.tgac.miso.persistence.RunStore) Date(java.util.Date) Mock(org.mockito.Mock) LocalDateTime(java.time.LocalDateTime) KitDescriptorService(uk.ac.bbsrc.tgac.miso.core.service.KitDescriptorService) HealthType(uk.ac.bbsrc.tgac.miso.core.data.type.HealthType) RunPartition(uk.ac.bbsrc.tgac.miso.core.data.RunPartition) InstrumentDataManglingPolicy(uk.ac.bbsrc.tgac.miso.core.data.InstrumentDataManglingPolicy) SequencingContainerModelService(uk.ac.bbsrc.tgac.miso.core.service.SequencingContainerModelService) IlluminaRun(uk.ac.bbsrc.tgac.miso.core.data.IlluminaRun) InstrumentType(uk.ac.bbsrc.tgac.miso.core.data.type.InstrumentType) UserService(uk.ac.bbsrc.tgac.miso.core.service.UserService) MockitoAnnotations(org.mockito.MockitoAnnotations) ChangeLog(uk.ac.bbsrc.tgac.miso.core.data.ChangeLog) UserImpl(uk.ac.bbsrc.tgac.miso.core.data.impl.UserImpl) Run(uk.ac.bbsrc.tgac.miso.core.data.Run) GetLaneContents(uk.ac.bbsrc.tgac.miso.core.data.GetLaneContents) SequencerPartitionContainer(uk.ac.bbsrc.tgac.miso.core.data.SequencerPartitionContainer) SequencerPartitionContainerImpl(uk.ac.bbsrc.tgac.miso.core.data.impl.SequencerPartitionContainerImpl) ContainerService(uk.ac.bbsrc.tgac.miso.core.service.ContainerService) ZoneOffset(java.time.ZoneOffset) InstrumentImpl(uk.ac.bbsrc.tgac.miso.core.data.impl.InstrumentImpl) RunPartitionService(uk.ac.bbsrc.tgac.miso.core.service.RunPartitionService) ValidationError(uk.ac.bbsrc.tgac.miso.core.service.exception.ValidationError) Before(org.junit.Before) InjectMocks(org.mockito.InjectMocks) ValidationException(uk.ac.bbsrc.tgac.miso.core.service.exception.ValidationException) Predicate(java.util.function.Predicate) IOException(java.io.IOException) Test(org.junit.Test) SequencingParameters(uk.ac.bbsrc.tgac.miso.core.data.SequencingParameters) Partition(uk.ac.bbsrc.tgac.miso.core.data.Partition) Mockito(org.mockito.Mockito) RunPosition(uk.ac.bbsrc.tgac.miso.core.data.impl.RunPosition) SequencingParametersService(uk.ac.bbsrc.tgac.miso.core.service.SequencingParametersService) InstrumentService(uk.ac.bbsrc.tgac.miso.core.service.InstrumentService) Assert.assertFalse(org.junit.Assert.assertFalse) PoolService(uk.ac.bbsrc.tgac.miso.core.service.PoolService) Optional(java.util.Optional) PlatformType(uk.ac.bbsrc.tgac.miso.core.data.type.PlatformType) Instrument(uk.ac.bbsrc.tgac.miso.core.data.Instrument) InstrumentModel(uk.ac.bbsrc.tgac.miso.core.data.InstrumentModel) SequencingParameters(uk.ac.bbsrc.tgac.miso.core.data.SequencingParameters) IlluminaRun(uk.ac.bbsrc.tgac.miso.core.data.IlluminaRun) Run(uk.ac.bbsrc.tgac.miso.core.data.Run) GetLaneContents(uk.ac.bbsrc.tgac.miso.core.data.GetLaneContents) Test(org.junit.Test)

Aggregations

User (com.eaglegenomics.simlims.core.User)2 IOException (java.io.IOException)2 LocalDateTime (java.time.LocalDateTime)2 ZoneOffset (java.time.ZoneOffset)2 Arrays (java.util.Arrays)2 Date (java.util.Date)2 Optional (java.util.Optional)2 Predicate (java.util.function.Predicate)2 Assert.assertFalse (org.junit.Assert.assertFalse)2 Before (org.junit.Before)2 Test (org.junit.Test)2 InjectMocks (org.mockito.InjectMocks)2 Mock (org.mockito.Mock)2 Mockito (org.mockito.Mockito)2 MockitoAnnotations (org.mockito.MockitoAnnotations)2 ChangeLog (uk.ac.bbsrc.tgac.miso.core.data.ChangeLog)2 GetLaneContents (uk.ac.bbsrc.tgac.miso.core.data.GetLaneContents)2 IlluminaRun (uk.ac.bbsrc.tgac.miso.core.data.IlluminaRun)2 Instrument (uk.ac.bbsrc.tgac.miso.core.data.Instrument)2 InstrumentDataManglingPolicy (uk.ac.bbsrc.tgac.miso.core.data.InstrumentDataManglingPolicy)2