RuleEntityServiceImpl implements RuleEntityService { @Override public List<RuleEntity> findAll() { return ruleEntityRepository.findAll(); }  @Override RuleEntity save(final RuleDTO ruleDTO); @Override RuleEntity update(final RuleDTO ruleDTO, final Long id); @Override RuleEntity findById(final Long id); @Override List<RuleEntity> findByNotExpired(); @Override List<RuleEntity> findAll(); @Override void expire(final Long id, final DateTime newExpiryDate);  }
@Test public void testFindAll() throws Exception { when(ruleEntityRepository.findAll()).thenReturn(newArrayList(ruleEntity)); final List<RuleEntity> ruleEntities = ruleEntityServiceImpl.findAll(); assertThat(ruleEntities).hasSize(1); verify(ruleEntityRepository).findAll(); }