Search in sources :

Example 1 with SbpRestApi

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

the class ApiPersistedDatasetTest method setUp.

@Before
public void setUp() throws Exception {
    final SbpRestApi restApi = mock(SbpRestApi.class);
    when(restApi.getDataset(BIOPSY)).thenReturn(TestJson.get("get_dataset"));
    victim = new ApiPersistedDataset(restApi, ObjectMappers.get(), BIOPSY, "project");
}
Also used : SbpRestApi(com.hartwig.pipeline.sbpapi.SbpRestApi) Before(org.junit.Before)

Example 2 with SbpRestApi

use of com.hartwig.pipeline.sbpapi.SbpRestApi 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

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