ConsumerCurator extends AbstractHibernateCurator<Consumer> { public Collection<Consumer> getConsumers(Collection<String> consumerIds) { if (consumerIds != null && !consumerIds.isEmpty()) { List<String> cids; if (consumerIds instanceof List) { cids = (List<String>) consumerIds; } else { cids = new ArrayList(consumerIds); } return this.currentSession() .byMultipleIds(this.entityType()) .enableSessionCheck(true) .enableOrderedReturn(false) .multiLoad(cids); } return Collections.emptyList(); } ConsumerCurator(); @Transactional @Override Consumer create(Consumer entity, boolean flush); @Override @Transactional void delete(Consumer entity); @Transactional Consumer replicate(Consumer consumer); @Transactional Consumer findByVirtUuid(String uuid, String ownerId); @Transactional VirtConsumerMap getGuestConsumersMap(String ownerId, Set<String> guestIds); @Transactional Consumer findByUser(User user); @Transactional Consumer findByUsername(String username); @Transactional Consumer findByUuid(String uuid); @Transactional Collection<Consumer> findByUuids(Collection<String> uuids); @Transactional Collection<Consumer> findByUuidsAndOwner(Collection<String> uuids, String ownerId); Consumer getConsumer(String uuid); Collection<Consumer> getConsumers(Collection<String> consumerIds); @SuppressWarnings("unchecked") @Transactional List<String> getDistinctSyspurposeRolesByOwner(Owner owner); @SuppressWarnings("unchecked") @Transactional List<String> getDistinctSyspurposeUsageByOwner(Owner owner); @SuppressWarnings("unchecked") @Transactional List<String> getDistinctSyspurposeServicelevelByOwner(Owner owner); @SuppressWarnings("unchecked") @Transactional List<String> getDistinctSyspurposeAddonsByOwner(Owner owner); @SuppressWarnings("unchecked") @Transactional CandlepinQuery<Consumer> listByOwner(Owner owner); @SuppressWarnings("unchecked") @Transactional CandlepinQuery<Consumer> listByUsernameAndType(String userName, List<ConsumerType> types,
        Owner owner); @Transactional Consumer update(Consumer updatedConsumer); @Transactional Consumer update(Consumer updatedConsumer, boolean flush); void updateLastCheckin(Consumer consumer); @Transactional void updateLastCheckin(Consumer consumer, Date checkinDate); @Transactional void heartbeatUpdate(final String reporterId, final Date checkIn, final String ownerKey); @Transactional Set<Consumer> bulkUpdate(Set<Consumer> consumers); @Transactional Set<Consumer> bulkUpdate(Set<Consumer> consumers, boolean flush); @Transactional Consumer getHost(String guestId, String ownerId); Map<String, GuestId> getGuestIdMap(Iterable<String> guestIds, Owner owner); @Transactional List<Consumer> getGuests(Consumer consumer); @Transactional Consumer getHypervisor(String hypervisorId, Owner owner); @Transactional VirtConsumerMap getHostConsumersMap(Owner owner, Iterable<String> hypervisorIds); @Transactional VirtConsumerMap getHostConsumersMap(Owner owner, List<Consumer> hypervisors); @Transactional Consumer getExistingConsumerByHypervisorIdOrUuid(String ownerId, String hypervisorId,
        String systemUuid); @SuppressWarnings("unchecked") @Transactional CandlepinQuery<Consumer> getHypervisorsBulk(Iterable<String> hypervisorIds, String ownerId); @SuppressWarnings("unchecked") @Transactional CandlepinQuery<Consumer> getHypervisorsForOwner(String ownerId); boolean doesConsumerExist(String uuid); Set<String> getExistingConsumerUuids(Iterable<String> consumerUuids); Consumer verifyAndLookupConsumer(String consumerUuid); Consumer verifyAndLookupConsumerWithEntitlements(String consumerUuid); @SuppressWarnings("checkstyle:indentation") CandlepinQuery<Consumer> searchOwnerConsumers(Owner owner, String userName,
        Collection<ConsumerType> types, List<String> uuids, List<String> hypervisorIds,
        List<KeyValueParameter> factFilters, List<String> skus,
        List<String> subscriptionIds, List<String> contracts); int countConsumers(String ownerKey,
        Collection<String> typeLabels, Collection<String> skus,
        Collection<String> subscriptionIds, Collection<String> contracts); int getConsumerCount(Owner owner, ConsumerType type); int getConsumerEntitlementCount(Owner owner, ConsumerType type); @SuppressWarnings("unchecked") List<String> getConsumerIdsWithStartedEnts(); int cullInvalidConsumerContentAccess(Owner owner, String... existingModes);  }
@Test public void testGetConsumersNoConsumers() { List<Consumer> expected = this.getConsumersDirect(); assertTrue(expected.isEmpty()); List<String> cids = Arrays.asList("c1", "c2", "c3"); Collection<Consumer> actual = consumerCurator.getConsumers(cids); assertTrue(actual.isEmpty()); }