@Test public void addCourtDataToModel_CourtType_SUPREME_ChamberId_NOT_NULL() { courtCriteria.setCourtType(CourtType.SUPREME); courtCriteria.setScCourtChamberId(120L); List<SimpleEntity> supremeChambers = createSimpleEntities(); when(scListService.findScChambers()).thenReturn(supremeChambers); List<SimpleEntity> supremeChamberDivisions = createSimpleEntities(); when(scListService.findScChamberDivisions(courtCriteria.getScCourtChamberId())).thenReturn(supremeChamberDivisions); courtDataModelCreator.addCourtDataToModel(courtCriteria, model); verify(model).addAttribute("supremeChambers", supremeChambers); verify(model).addAttribute("supremeChamberDivisions", supremeChamberDivisions); verify(scListService).findScChambers(); verify(scListService).findScChamberDivisions(courtCriteria.getScCourtChamberId()); verifyNoMoreInteractions(model, scListService); verifyZeroInteractions(ccListService); }
public void addCourtDataToModel(CourtCriteria courtCriteria, ModelMap model) { Preconditions.checkNotNull(courtCriteria); Preconditions.checkNotNull(model); addCommonCourtsToModel(courtCriteria, model); addSupremeCourtChambersToModel(courtCriteria, model); }
CourtDataModelCreator { public void addCourtDataToModel(CourtCriteria courtCriteria, ModelMap model) { Preconditions.checkNotNull(courtCriteria); Preconditions.checkNotNull(model); addCommonCourtsToModel(courtCriteria, model); addSupremeCourtChambersToModel(courtCriteria, model); } }
CourtDataModelCreator { public void addCourtDataToModel(CourtCriteria courtCriteria, ModelMap model) { Preconditions.checkNotNull(courtCriteria); Preconditions.checkNotNull(model); addCommonCourtsToModel(courtCriteria, model); addSupremeCourtChambersToModel(courtCriteria, model); }  }
CourtDataModelCreator { public void addCourtDataToModel(CourtCriteria courtCriteria, ModelMap model) { Preconditions.checkNotNull(courtCriteria); Preconditions.checkNotNull(model); addCommonCourtsToModel(courtCriteria, model); addSupremeCourtChambersToModel(courtCriteria, model); }  void addCourtDataToModel(CourtCriteria courtCriteria, ModelMap model); @Autowired void setCcListService(CcListService ccListService); @Autowired void setScListService(ScListService scListService); }
CourtDataModelCreator { public void addCourtDataToModel(CourtCriteria courtCriteria, ModelMap model) { Preconditions.checkNotNull(courtCriteria); Preconditions.checkNotNull(model); addCommonCourtsToModel(courtCriteria, model); addSupremeCourtChambersToModel(courtCriteria, model); }  void addCourtDataToModel(CourtCriteria courtCriteria, ModelMap model); @Autowired void setCcListService(CcListService ccListService); @Autowired void setScListService(ScListService scListService);  }