OwnerCurator extends AbstractHibernateCurator<Owner> { public CandlepinQuery<String> getConsumerUuids(Owner owner) { return this.getConsumerUuids(owner.getId()); } OwnerCurator(); Owner findOwnerById(String ownerId); @Transactional Owner replicate(Owner owner); @Transactional @Override Owner create(Owner entity); @Transactional Owner getByKeySecure(String key); Owner lockAndLoadByKey(String key); @Transactional Owner getByKey(String key); @Transactional CandlepinQuery<Owner> getByKeys(Collection<String> keys); Owner getByUpstreamUuid(String upstreamUuid); CandlepinQuery<Owner> getOwnersByActiveProduct(Collection<String> productIds); @SuppressWarnings("checkstyle:indentation") CandlepinQuery<Owner> getOwnersWithProducts(Collection<String> productIds); CandlepinQuery<String> getConsumerIds(Owner owner); @SuppressWarnings("unchecked") CandlepinQuery<String> getConsumerIds(String ownerId); CandlepinQuery<String> getConsumerUuids(Owner owner); @SuppressWarnings("unchecked") CandlepinQuery<String> getConsumerUuids(String ownerId);  }
@Test public void getConsumerUuids() { ConsumerType type = new ConsumerType(ConsumerTypeEnum.SYSTEM); consumerTypeCurator.create(type); Owner owner = new Owner("owner"); Owner otherOwner = new Owner("other owner"); ownerCurator.create(owner); ownerCurator.create(otherOwner); Consumer c1 = new Consumer("name1", "uname1", owner, type); Consumer c2 = new Consumer("name2", "uname2", owner, type); Consumer c3 = new Consumer("name3", "uname3", otherOwner, type); consumerCurator.create(c1); consumerCurator.create(c2); consumerCurator.create(c3); List<String> result = ownerCurator.getConsumerUuids(owner).list(); assertEquals(2, result.size()); assertTrue(result.contains(c1.getUuid())); assertTrue(result.contains(c2.getUuid())); assertFalse(result.contains(c3.getUuid())); }