use of com.hartwig.api.model.UpdateRun in project pipeline5 by hartwigmedical.
the class DiagnosticSomaticMetadataApiTest method setsStatusToProcessingResultNullAndStartTimeOnStartup.
@Test
public void setsStatusToProcessingResultNullAndStartTimeOnStartup() {
victim.start();
verify(runApi).update(runIdCaptor.capture(), updateCaptor.capture());
assertThat(runIdCaptor.getValue()).isEqualTo(RUN_ID);
UpdateRun update = updateCaptor.getValue();
assertThat(update.getFailure()).isNull();
assertThat(update.getStatus()).isEqualTo(Status.PROCESSING);
assertThat(update.getStartTime()).isNotNull();
}
use of com.hartwig.api.model.UpdateRun in project pipeline5 by hartwigmedical.
the class DiagnosticSomaticMetadataApiTest method setsEndTimeOnCompletion.
@Test
public void setsEndTimeOnCompletion() {
when(pipelineState.status()).thenReturn(PipelineStatus.FAILED);
victim.complete(pipelineState, somaticRunMetadata);
verify(runApi).update(runIdCaptor.capture(), updateCaptor.capture());
UpdateRun update = updateCaptor.getValue();
assertThat(update.getEndTime()).isNotNull();
}
use of com.hartwig.api.model.UpdateRun in project pipeline5 by hartwigmedical.
the class ResearchMetadataApiTest method setsStatusAndEndTimeOnComplete.
@Test
public void setsStatusAndEndTimeOnComplete() {
ArgumentCaptor<Long> runIdArgumentCaptor = ArgumentCaptor.forClass(Long.class);
ArgumentCaptor<UpdateRun> updateRunArgumentCaptor = ArgumentCaptor.forClass(UpdateRun.class);
when(runApi.update(runIdArgumentCaptor.capture(), updateRunArgumentCaptor.capture())).thenReturn(run);
PipelineState state = new PipelineState();
state.add(TestOutput.builder().status(PipelineStatus.FAILED).build());
victim.complete(state, TestInputs.defaultSomaticRunMetadata());
assertThat(runIdArgumentCaptor.getValue()).isEqualTo(RUN_ID);
UpdateRun updateRun = updateRunArgumentCaptor.getValue();
assertThat(updateRun.getEndTime()).isNotNull();
assertThat(updateRun.getStatus()).isEqualTo(Status.FAILED);
}
use of com.hartwig.api.model.UpdateRun in project pipeline5 by hartwigmedical.
the class ResearchMetadataApiTest method setsStatusAndStartTimeOnStart.
@Test
public void setsStatusAndStartTimeOnStart() {
ArgumentCaptor<Long> runIdArgumentCaptor = ArgumentCaptor.forClass(Long.class);
ArgumentCaptor<UpdateRun> updateRunArgumentCaptor = ArgumentCaptor.forClass(UpdateRun.class);
when(runApi.update(runIdArgumentCaptor.capture(), updateRunArgumentCaptor.capture())).thenReturn(run);
victim.start();
assertThat(runIdArgumentCaptor.getValue()).isEqualTo(RUN_ID);
UpdateRun updateRun = updateRunArgumentCaptor.getValue();
assertThat(updateRun.getStartTime()).isNotNull();
assertThat(updateRun.getStatus()).isEqualTo(Status.PROCESSING);
}
Aggregations