@Test public void findScJudgmentForms() { SupremeCourtJudgmentForm scJudgmentFormOne = new SupremeCourtJudgmentForm(); scJudgmentFormOne.setName("wyrok SN SD"); SupremeCourtJudgmentForm scJudgmentFormTwo = new SupremeCourtJudgmentForm(); scJudgmentFormTwo.setName("postanowienie siedmiu sędziów SN"); SupremeCourtJudgmentForm scJudgmentFormThree = new SupremeCourtJudgmentForm(); scJudgmentFormThree.setName("uchwała całej izby SN"); SimpleEntity simpleScJudgmentFormOne = new SimpleEntity(); simpleScJudgmentFormOne.setName("wyrok SN SD"); SimpleEntity simpleScJudgmentFormTwo = new SimpleEntity(); simpleScJudgmentFormTwo.setName("postanowienie siedmiu sędziów SN"); SimpleEntity simpleScJudgmentFormThree = new SimpleEntity(); simpleScJudgmentFormThree.setName("uchwała całej izby SN"); List<SupremeCourtJudgmentForm> scJudgmentForms = Arrays.asList(scJudgmentFormOne, scJudgmentFormTwo, scJudgmentFormThree); when(scJudgmentFormRepository.findAll()).thenReturn(scJudgmentForms); when(simpleEntityConverter.convertScJudgmentForms(scJudgmentForms)) .thenReturn(Arrays.asList(simpleScJudgmentFormOne, simpleScJudgmentFormTwo, simpleScJudgmentFormThree)); List<SimpleEntity> convertedScJudgmentForms = scListService.findScJudgmentForms(); assertEquals(3, convertedScJudgmentForms.size()); assertEquals(convertedScJudgmentForms.get(0).getName(), scJudgmentFormOne.getName()); assertEquals(convertedScJudgmentForms.get(1).getName(), scJudgmentFormTwo.getName()); assertEquals(convertedScJudgmentForms.get(2).getName(), scJudgmentFormThree.getName()); }
@Cacheable(DICTIONARIES) public List<SimpleEntity> findScJudgmentForms() { return simpleEntityConverter.convertScJudgmentForms(scJudgmentFormRepository.findAll()); }
ScListService { @Cacheable(DICTIONARIES) public List<SimpleEntity> findScJudgmentForms() { return simpleEntityConverter.convertScJudgmentForms(scJudgmentFormRepository.findAll()); } }
ScListService { @Cacheable(DICTIONARIES) public List<SimpleEntity> findScJudgmentForms() { return simpleEntityConverter.convertScJudgmentForms(scJudgmentFormRepository.findAll()); }  }
ScListService { @Cacheable(DICTIONARIES) public List<SimpleEntity> findScJudgmentForms() { return simpleEntityConverter.convertScJudgmentForms(scJudgmentFormRepository.findAll()); }  @Cacheable(DICTIONARIES) List<SimpleEntity> findScChambers(); @Cacheable(DICTIONARIES) List<SimpleEntity> findScChamberDivisions(long chamberId); @Cacheable(DICTIONARIES) List<SimpleEntity> findScJudgmentForms(); @Autowired void setScChamberRepository(ScChamberRepository scChamberRepository); @Autowired void setScChamberDivisionRepository(ScChamberDivisionRepository scChamberDivisionRepository); @Autowired void setScJudgmentFormRepository(ScJudgmentFormRepository scJudgmentFormRepository); @Autowired void setSimpleEntityConverter(SimpleEntityConverter simpleEntityConverter); }
ScListService { @Cacheable(DICTIONARIES) public List<SimpleEntity> findScJudgmentForms() { return simpleEntityConverter.convertScJudgmentForms(scJudgmentFormRepository.findAll()); }  @Cacheable(DICTIONARIES) List<SimpleEntity> findScChambers(); @Cacheable(DICTIONARIES) List<SimpleEntity> findScChamberDivisions(long chamberId); @Cacheable(DICTIONARIES) List<SimpleEntity> findScJudgmentForms(); @Autowired void setScChamberRepository(ScChamberRepository scChamberRepository); @Autowired void setScChamberDivisionRepository(ScChamberDivisionRepository scChamberDivisionRepository); @Autowired void setScJudgmentFormRepository(ScJudgmentFormRepository scJudgmentFormRepository); @Autowired void setSimpleEntityConverter(SimpleEntityConverter simpleEntityConverter);  }