DefaultProductServiceAdapter implements ProductServiceAdapter { @Override @Transactional public Collection<? extends ProductInfo> getProductsByIds(String ownerKey, Collection<String> ids) { return this.ownerProductCurator.getProductsByIdsUsingOwnerKey(ownerKey, ids).list(); } @Inject  DefaultProductServiceAdapter(OwnerProductCurator ownerProductCurator,
        ProductCertificateCurator prodCertCurator, ContentCurator contentCurator,
        UniqueIdGenerator idGenerator); @Override CertificateInfo getProductCertificate(String ownerKey, String productId); @Override @Transactional Collection<? extends ProductInfo> getProductsByIds(String ownerKey, Collection<String> ids);  }
@Test public void productsByIds() { Owner o = mock(Owner.class); List<String> ids = new ArrayList<>(); CandlepinQuery<Product> ccmock = mock(CandlepinQuery.class); ResultIterator<Product> iterator = mock(ResultIterator.class); when(opc.getProductsByIdsUsingOwnerKey(nullable(String.class), anyCollection())).thenReturn(ccmock); when(ccmock.iterate(anyInt(), anyBoolean())).thenReturn(iterator); ids.add(someid); dpsa.getProductsByIds(o.getKey(), ids); verify(opc).getProductsByIdsUsingOwnerKey(eq(o.getKey()), eq(ids)); }