Search in sources :

Example 6 with Run

use of com.hartwig.api.model.Run in project pipeline5 by hartwigmedical.

the class DiagnosticSomaticMetadataApiTest method throwsIllegalStateIfNoBucketInRun.

@Test(expected = IllegalStateException.class)
public void throwsIllegalStateIfNoBucketInRun() {
    victim = new DiagnosticSomaticMetadataApi(new Run().bucket(null), runApi, sampleApi, publisher, new Anonymizer(Arguments.testDefaults()));
    when(pipelineState.status()).thenReturn(PipelineStatus.FAILED);
    victim.complete(pipelineState, somaticRunMetadata);
}
Also used : Run(com.hartwig.api.model.Run) UpdateRun(com.hartwig.api.model.UpdateRun) Test(org.junit.Test)

Example 7 with Run

use of com.hartwig.api.model.Run in project pipeline5 by hartwigmedical.

the class ResearchMetadataApiTest method setUp.

@Before
public void setUp() throws Exception {
    sampleApi = mock(SampleApi.class);
    setApi = mock(SetApi.class);
    bucket = mock(Bucket.class);
    when(bucket.getName()).thenReturn("bucket");
    runApi = mock(RunApi.class);
    run = new Run().id(RUN_ID);
    publisher = mock(Publisher.class);
    ObjectMapper objectMapper = ObjectMappers.get();
    setResolver = mock(SetResolver.class);
    victim = new ResearchMetadataApi(sampleApi, setApi, runApi, Optional.of(run), BIOPSY, Arguments.testDefaults(), new StagedOutputPublisher(setResolver, bucket, publisher, objectMapper, Optional.of(run), Context.RESEARCH, false, true), new Anonymizer(Arguments.testDefaults()));
}
Also used : Bucket(com.google.cloud.storage.Bucket) SampleApi(com.hartwig.api.SampleApi) Run(com.hartwig.api.model.Run) UpdateRun(com.hartwig.api.model.UpdateRun) Publisher(com.google.cloud.pubsub.v1.Publisher) StagedOutputPublisher(com.hartwig.pipeline.transfer.staged.StagedOutputPublisher) SetResolver(com.hartwig.pipeline.transfer.staged.SetResolver) RunApi(com.hartwig.api.RunApi) ObjectMapper(com.fasterxml.jackson.databind.ObjectMapper) StagedOutputPublisher(com.hartwig.pipeline.transfer.staged.StagedOutputPublisher) SetApi(com.hartwig.api.SetApi) Before(org.junit.Before)

Example 8 with Run

use of com.hartwig.api.model.Run in project pipeline5 by hartwigmedical.

the class StagedOutputPublisherTest method setUp.

@Before
public void setUp() throws Exception {
    bucket = mock(Bucket.class);
    when(bucket.getName()).thenReturn("bucket");
    publisher = mock(Publisher.class);
    state = mock(PipelineState.class);
    setResolver = mock(SetResolver.class);
    victim = new StagedOutputPublisher(setResolver, bucket, publisher, OBJECT_MAPPER, Optional.of(new Run().ini(Ini.SOMATIC_INI.getValue()).id(1L)), Context.DIAGNOSTIC, true, false);
}
Also used : PipelineState(com.hartwig.pipeline.PipelineState) Bucket(com.google.cloud.storage.Bucket) Run(com.hartwig.api.model.Run) Publisher(com.google.cloud.pubsub.v1.Publisher) Before(org.junit.Before)

Aggregations

Run (com.hartwig.api.model.Run)8 RunApi (com.hartwig.api.RunApi)3 SampleApi (com.hartwig.api.SampleApi)3 Publisher (com.google.cloud.pubsub.v1.Publisher)2 Bucket (com.google.cloud.storage.Bucket)2 HmfApi (com.hartwig.api.HmfApi)2 SetApi (com.hartwig.api.SetApi)2 Sample (com.hartwig.api.model.Sample)2 SampleType (com.hartwig.api.model.SampleType)2 UpdateRun (com.hartwig.api.model.UpdateRun)2 PipelineState (com.hartwig.pipeline.PipelineState)2 StagedOutputPublisher (com.hartwig.pipeline.transfer.staged.StagedOutputPublisher)2 List (java.util.List)2 Optional (java.util.Optional)2 Before (org.junit.Before)2 Test (org.junit.Test)2 Logger (org.slf4j.Logger)2 LoggerFactory (org.slf4j.LoggerFactory)2 ObjectMapper (com.fasterxml.jackson.databind.ObjectMapper)1 ApiException (com.hartwig.ApiException)1