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