Search in sources :

Example 1 with AddFileApiResponse

use of com.hartwig.pipeline.sbpapi.AddFileApiResponse in project pipeline5 by hartwigmedical.

the class AddDatatypeTest method shouldPatchFileWithDataTypeAndLinkFileToSample.

@Test
public void shouldPatchFileWithDataTypeAndLinkFileToSample() {
    int id = 100;
    SbpRestApi api = mock(SbpRestApi.class);
    AddFileApiResponse file = mock(AddFileApiResponse.class);
    when(file.id()).thenReturn(id);
    AddDatatype victim = new AddDatatype(DataType.ALIGNED_READS, "barcode", new ArchivePath(Folder.root(), "namespace", "filename"));
    victim.apply(api, file);
    verify(api).patchFile(id, "datatype", DataType.ALIGNED_READS.toString().toLowerCase());
    verify(api).linkFileToSample(id, "barcode");
}
Also used : AddFileApiResponse(com.hartwig.pipeline.sbpapi.AddFileApiResponse) SbpRestApi(com.hartwig.pipeline.sbpapi.SbpRestApi) Test(org.junit.Test)

Aggregations

AddFileApiResponse (com.hartwig.pipeline.sbpapi.AddFileApiResponse)1 SbpRestApi (com.hartwig.pipeline.sbpapi.SbpRestApi)1 Test (org.junit.Test)1