DeletedConsumerCurator extends AbstractHibernateCurator<DeletedConsumer> { public DeletedConsumer findByConsumer(Consumer c) { return findByConsumerUuid(c.getUuid()); } 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 byConsumer() { Consumer c = mock(Consumer.class); when(c.getUuid()).thenReturn("abcde"); DeletedConsumer found = dcc.findByConsumer(c); assertEquals("abcde", found.getConsumerUuid()); }