EntitlementCertificateGenerator { @Transactional public Map<String, EntitlementCertificate> generateEntitlementCertificates(Consumer consumer, Map<String, Product> products, Map<String, PoolQuantity> poolQuantities, Map<String, Entitlement> entitlements, boolean save) { try { return this.entCertServiceAdapter.generateEntitlementCerts(consumer, poolQuantities, entitlements, products, save); } catch (CertVersionConflictException cvce) { throw cvce; } catch (CertificateSizeException cse) { throw cse; } catch (Exception ex) { throw new RuntimeException(ex); } } @Inject  EntitlementCertificateGenerator(EntitlementCertificateCurator entitlementCertificateCurator,
        EntitlementCertServiceAdapter entCertServiceAdapter, EntitlementCurator entitlementCurator,
        PoolCurator poolCurator, EventSink eventSink, EventFactory eventFactory,
        ProductCurator productCurator, ContentAccessManager contentAccessManager,
        OwnerCurator ownerCurator); @Transactional Map<String, EntitlementCertificate> generateEntitlementCertificates(Consumer consumer,
        Map<String, Product> products, Map<String, PoolQuantity> poolQuantities,
        Map<String, Entitlement> entitlements, boolean save); @Transactional EntitlementCertificate generateEntitlementCertificate(Pool pool, Entitlement entitlement); @Transactional EntitlementCertificate generateEntitlementCertificate(Pool pool, Entitlement entitlement,
        boolean updateEntitlement); @Transactional void regenerateCertificatesOf(Entitlement entitlement, boolean lazy); @Transactional void regenerateCertificatesOf(Iterable<Entitlement> entitlements, boolean lazy); @Transactional void regenerateCertificatesByEntitlementIds(Iterable<String> entitlementIds, boolean lazy); @Transactional void regenerateCertificatesOf(Consumer consumer, boolean lazy); @Transactional void regenerateCertificatesOf(String environmentId, Collection<String> contentIds,
        boolean lazy); @Transactional void regenerateCertificatesOf(Owner owner, String productId, boolean lazy); @Transactional void regenerateCertificatesOf(Owner owner, Product product, boolean lazy); @Transactional void regenerateCertificatesOf(Collection<Owner> owners, Collection<Product> products,
        boolean lazy);  }
@Test public void testGenerateEntitlementCertificates() throws GeneralSecurityException, IOException { this.ecGenerator = new EntitlementCertificateGenerator(this.mockEntCertCurator, this.mockEntCertAdapter, this.mockEntitlementCurator, this.mockPoolCurator, this.mockEventSink, this.mockEventFactory, this.mockProductCurator, this.mockContentAccessManager, this.mockOwnerCurator); Consumer consumer = mock(Consumer.class); Product product = mock(Product.class); Entitlement entitlement = mock(Entitlement.class); Pool pool = mock(Pool.class); Map<String, Product> products = new HashMap<>(); products.put("Taylor", product); Map<String, Entitlement> entitlements = new HashMap<>(); entitlements.put("Taylor", entitlement); Map<String, PoolQuantity> poolQuantities = new HashMap<>(); poolQuantities.put("Taylor", new PoolQuantity(pool, 1)); ecGenerator.generateEntitlementCertificates(consumer, products, poolQuantities, entitlements, true); verify(mockEntCertAdapter).generateEntitlementCerts(eq(consumer), eq(poolQuantities), eq (entitlements), eq(products), anyBoolean()); }