Search in sources :

Example 1 with UpdateRun

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();
}
Also used : UpdateRun(com.hartwig.api.model.UpdateRun) Test(org.junit.Test)

Example 2 with UpdateRun

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();
}
Also used : UpdateRun(com.hartwig.api.model.UpdateRun) Test(org.junit.Test)

Example 3 with UpdateRun

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);
}
Also used : PipelineState(com.hartwig.pipeline.PipelineState) UpdateRun(com.hartwig.api.model.UpdateRun) Test(org.junit.Test)

Example 4 with UpdateRun

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);
}
Also used : UpdateRun(com.hartwig.api.model.UpdateRun) Test(org.junit.Test)

Aggregations

UpdateRun (com.hartwig.api.model.UpdateRun)4 Test (org.junit.Test)4 PipelineState (com.hartwig.pipeline.PipelineState)1