DefaultLibraryAliquotService implements LibraryAliquotService, PaginatedDataSource<LibraryAliquot> { @VisibleForTesting protected boolean isTargetedSequencingCompatible(TargetedSequencing ts, Library library) { return library.getKitDescriptor().getTargetedSequencing().contains(ts); }  @Override LibraryAliquot get(long id); @Override long create(LibraryAliquot aliquot); @Override long update(LibraryAliquot aliquot); @Override int count(); @Override List<LibraryAliquot> list(); @Override List<LibraryAliquot> listByLibraryId(Long libraryId); @Override LibraryAliquot getByBarcode(String barcode); void setLibraryAliquotDao(LibraryAliquotStore libraryAliquotDao); void setAuthorizationManager(AuthorizationManager authorizationManager); void setNamingSchemeHolder(NamingSchemeHolder namingSchemeHolder); void setTargetedSequencingService(TargetedSequencingService targetedSequencingService); void setBoxService(BoxService boxService); void setAutoGenerateIdBarcodes(Boolean autoGenerateIdBarcodes); void setLibraryService(LibraryService libraryService); void setWorksetService(WorksetService worksetService); @Override AuthorizationManager getAuthorizationManager(); @Override List<LibraryAliquot> listByIdList(List<Long> idList); @Override DeletionStore getDeletionStore(); @Override void authorizeDeletion(LibraryAliquot object); @Override ValidationResult validateDeletion(LibraryAliquot object); @Override void beforeDelete(LibraryAliquot object); @Override long count(Consumer<String> errorHandler, PaginationFilter... filter); @Override List<LibraryAliquot> list(Consumer<String> errorHandler, int offset, int limit, boolean sortDir, String sortCol,
      PaginationFilter... filter); @Override TransactionTemplate getTransactionTemplate();  }
@Test public void testEmptyTargetedSequencingCompatibility() { TargetedSequencing ts = new TargetedSequencing(); addTargetedSequencing(ts, library); assertTrue(service.isTargetedSequencingCompatible(ts, library)); }
@Test public void testDistinctEmptyTargetedSequencingCompatibility() { TargetedSequencing ts1 = new TargetedSequencing(); TargetedSequencing ts2 = new TargetedSequencing(); addTargetedSequencing(ts2, library); assertTrue(service.isTargetedSequencingCompatible(ts1, library)); }
@Test public void testDistinctEqualTargetedSequencingCompatibility() { TargetedSequencing ts1 = defaultTargetedSequencing(); TargetedSequencing ts2 = defaultTargetedSequencing(); addTargetedSequencing(ts2, library); assertTrue(service.isTargetedSequencingCompatible(ts1, library)); }
@Test public void testUnequalTargetedSequencingIncompatibility() { TargetedSequencing ts1 = defaultTargetedSequencing(); TargetedSequencing ts2 = defaultTargetedSequencing(); ts2.setId(ts1.getId() + 1); addTargetedSequencing(ts2, library); assertFalse(service.isTargetedSequencingCompatible(ts1, library)); }