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");
}
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");
}
Aggregations