Search in sources :

Example 1 with StagedOutputPublisher

use of com.hartwig.pipeline.transfer.staged.StagedOutputPublisher in project pipeline5 by hartwigmedical.

the class LocalSomaticMetadataTest method setUp.

@Before
public void setUp() throws Exception {
    setId = "setId";
    tumorName = "CORE123T";
    refName = "CORE123R";
    jsonSampleSource = mock(JsonSampleSource.class);
    tumorSample = mock(Sample.class);
    final Sample refSample = mock(Sample.class);
    stagedOutputPublisher = mock(StagedOutputPublisher.class);
    victim = new LocalSomaticMetadata(Arguments.testDefaultsBuilder().setId(setId).build(), jsonSampleSource, stagedOutputPublisher);
    when(jsonSampleSource.sample(SampleType.REFERENCE)).thenReturn(Optional.of(refSample));
    when(tumorSample.name()).thenReturn(tumorName);
    when(refSample.name()).thenReturn(refName);
}
Also used : Sample(com.hartwig.patient.Sample) JsonSampleSource(com.hartwig.pipeline.alignment.sample.JsonSampleSource) StagedOutputPublisher(com.hartwig.pipeline.transfer.staged.StagedOutputPublisher) Before(org.junit.Before)

Example 2 with StagedOutputPublisher

use of com.hartwig.pipeline.transfer.staged.StagedOutputPublisher in project pipeline5 by hartwigmedical.

the class SomaticMetadataApiProvider method createPublisher.

private StagedOutputPublisher createPublisher(final SetResolver setResolver, final Optional<Run> run, final Context context, final boolean useOnlyDBSets) {
    Bucket sourceBucket = storage.get(arguments.outputBucket());
    ObjectMapper objectMapper = ObjectMappers.get();
    return new StagedOutputPublisher(setResolver, sourceBucket, publisher, objectMapper, run, context, arguments.outputCram(), useOnlyDBSets);
}
Also used : Bucket(com.google.cloud.storage.Bucket) ObjectMapper(com.fasterxml.jackson.databind.ObjectMapper) StagedOutputPublisher(com.hartwig.pipeline.transfer.staged.StagedOutputPublisher)

Example 3 with StagedOutputPublisher

use of com.hartwig.pipeline.transfer.staged.StagedOutputPublisher 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)

Aggregations

StagedOutputPublisher (com.hartwig.pipeline.transfer.staged.StagedOutputPublisher)3 ObjectMapper (com.fasterxml.jackson.databind.ObjectMapper)2 Bucket (com.google.cloud.storage.Bucket)2 Before (org.junit.Before)2 Publisher (com.google.cloud.pubsub.v1.Publisher)1 RunApi (com.hartwig.api.RunApi)1 SampleApi (com.hartwig.api.SampleApi)1 SetApi (com.hartwig.api.SetApi)1 Run (com.hartwig.api.model.Run)1 UpdateRun (com.hartwig.api.model.UpdateRun)1 Sample (com.hartwig.patient.Sample)1 JsonSampleSource (com.hartwig.pipeline.alignment.sample.JsonSampleSource)1 SetResolver (com.hartwig.pipeline.transfer.staged.SetResolver)1