@Test public void shouldGetInventoryCount() throws Exception { long[] facilityIds = {facilityId,facilityId2}; String strFacilityIds = "{"+facilityId+","+facilityId2+"}"; when(mapper.getInventoryCount(programId, equipmentTypeId, strFacilityIds)).thenReturn(2); int count = repository.getInventoryCount(programId, equipmentTypeId, facilityIds); verify(mapper).getInventoryCount(programId, equipmentTypeId, strFacilityIds); assertEquals(count, 2); }
public Integer getInventoryCount(Long programId, Long equipmentTypeId, long[] facilityIds) { String strFacilityIds = getFacilityIdString(facilityIds); return mapper.getInventoryCount(programId, equipmentTypeId, strFacilityIds); }
EquipmentInventoryRepository { public Integer getInventoryCount(Long programId, Long equipmentTypeId, long[] facilityIds) { String strFacilityIds = getFacilityIdString(facilityIds); return mapper.getInventoryCount(programId, equipmentTypeId, strFacilityIds); } }
EquipmentInventoryRepository { public Integer getInventoryCount(Long programId, Long equipmentTypeId, long[] facilityIds) { String strFacilityIds = getFacilityIdString(facilityIds); return mapper.getInventoryCount(programId, equipmentTypeId, strFacilityIds); }  }
EquipmentInventoryRepository { public Integer getInventoryCount(Long programId, Long equipmentTypeId, long[] facilityIds) { String strFacilityIds = getFacilityIdString(facilityIds); return mapper.getInventoryCount(programId, equipmentTypeId, strFacilityIds); }  List<EquipmentInventory> getFacilityInventory(Long facilityId, Long programId); List<EquipmentInventory> getInventory(Long programId, Long equipmentTypeId, long[] facilityIds, Pagination pagination); Integer getInventoryCount(Long programId, Long equipmentTypeId, long[] facilityIds); EquipmentInventory getInventoryById(Long id); void insert(EquipmentInventory inventory); void update(EquipmentInventory inventory); void updateStatus(EquipmentInventory inventory); String updateNonFunctionalEquipments(); }
EquipmentInventoryRepository { public Integer getInventoryCount(Long programId, Long equipmentTypeId, long[] facilityIds) { String strFacilityIds = getFacilityIdString(facilityIds); return mapper.getInventoryCount(programId, equipmentTypeId, strFacilityIds); }  List<EquipmentInventory> getFacilityInventory(Long facilityId, Long programId); List<EquipmentInventory> getInventory(Long programId, Long equipmentTypeId, long[] facilityIds, Pagination pagination); Integer getInventoryCount(Long programId, Long equipmentTypeId, long[] facilityIds); EquipmentInventory getInventoryById(Long id); void insert(EquipmentInventory inventory); void update(EquipmentInventory inventory); void updateStatus(EquipmentInventory inventory); String updateNonFunctionalEquipments(); static Logger logger; }