@Test public void shouldGetRequisitionGroupForSupervisoryNodes() { List<SupervisoryNode> supervisoryNodes = new ArrayList<>(); when(commaSeparator.commaSeparateIds(supervisoryNodes)).thenReturn("{1, 2}"); List<RequisitionGroup> requisitionGroups = new ArrayList<>(); when(mapper.getRequisitionGroupBySupervisoryNodes("{1, 2}")).thenReturn(requisitionGroups); List<RequisitionGroup> result = repository.getRequisitionGroups(supervisoryNodes); verify(mapper).getRequisitionGroupBySupervisoryNodes("{1, 2}"); assertThat(result, is(requisitionGroups)); }
public List<RequisitionGroup> getRequisitionGroups(List<SupervisoryNode> supervisoryNodes) { return mapper.getRequisitionGroupBySupervisoryNodes(commaSeparator.commaSeparateIds(supervisoryNodes)); }
RequisitionGroupRepository { public List<RequisitionGroup> getRequisitionGroups(List<SupervisoryNode> supervisoryNodes) { return mapper.getRequisitionGroupBySupervisoryNodes(commaSeparator.commaSeparateIds(supervisoryNodes)); } }
RequisitionGroupRepository { public List<RequisitionGroup> getRequisitionGroups(List<SupervisoryNode> supervisoryNodes) { return mapper.getRequisitionGroupBySupervisoryNodes(commaSeparator.commaSeparateIds(supervisoryNodes)); } @Autowired  RequisitionGroupRepository(RequisitionGroupMapper requisitionGroupMapper, CommaSeparator commaSeparator); }
RequisitionGroupRepository { public List<RequisitionGroup> getRequisitionGroups(List<SupervisoryNode> supervisoryNodes) { return mapper.getRequisitionGroupBySupervisoryNodes(commaSeparator.commaSeparateIds(supervisoryNodes)); } @Autowired  RequisitionGroupRepository(RequisitionGroupMapper requisitionGroupMapper, CommaSeparator commaSeparator); void insert(RequisitionGroup requisitionGroup); List<RequisitionGroup> getRequisitionGroups(List<SupervisoryNode> supervisoryNodes); RequisitionGroup getRequisitionGroupForProgramAndFacility(Program program, Facility facility); RequisitionGroup getByCode(RequisitionGroup requisitionGroup); void update(RequisitionGroup requisitionGroup); List<RequisitionGroup> searchByGroupName(String searchParam, Pagination pagination); List<RequisitionGroup> searchByNodeName(String searchParam, Pagination pagination); Integer getTotalRecordsForSearchOnGroupName(String searchParam); Integer getTotalRecordsForSearchOnNodeName(String searchParam); RequisitionGroup getBy(Long id); }
RequisitionGroupRepository { public List<RequisitionGroup> getRequisitionGroups(List<SupervisoryNode> supervisoryNodes) { return mapper.getRequisitionGroupBySupervisoryNodes(commaSeparator.commaSeparateIds(supervisoryNodes)); } @Autowired  RequisitionGroupRepository(RequisitionGroupMapper requisitionGroupMapper, CommaSeparator commaSeparator); void insert(RequisitionGroup requisitionGroup); List<RequisitionGroup> getRequisitionGroups(List<SupervisoryNode> supervisoryNodes); RequisitionGroup getRequisitionGroupForProgramAndFacility(Program program, Facility facility); RequisitionGroup getByCode(RequisitionGroup requisitionGroup); void update(RequisitionGroup requisitionGroup); List<RequisitionGroup> searchByGroupName(String searchParam, Pagination pagination); List<RequisitionGroup> searchByNodeName(String searchParam, Pagination pagination); Integer getTotalRecordsForSearchOnGroupName(String searchParam); Integer getTotalRecordsForSearchOnNodeName(String searchParam); RequisitionGroup getBy(Long id);  }