DeletedConsumerCurator extends AbstractHibernateCurator<DeletedConsumer> { public CandlepinQuery<DeletedConsumer> findByOwner(Owner o) { return findByOwnerId(o.getId()); } DeletedConsumerCurator(); DeletedConsumer findByConsumer(Consumer c); DeletedConsumer findByConsumerUuid(String uuid); CandlepinQuery<DeletedConsumer> findByOwner(Owner o); @SuppressWarnings("unchecked") CandlepinQuery<DeletedConsumer> findByOwnerId(String oid); int countByConsumer(Consumer c); int countByConsumerUuid(String uuid); @SuppressWarnings("unchecked") CandlepinQuery<DeletedConsumer> findByDate(Date date);  }
@Test public void byOwner() { Owner o = mock(Owner.class); when(o.getId()).thenReturn("20"); List<DeletedConsumer> found = dcc.findByOwner(o).list(); assertEquals(1, found.size()); }