@Test public void shouldGetNonCCEInventoryById() throws Exception { equipmentType.setColdChain(false); inventory.setEquipment(equipment); when(mapper.getInventoryById(inventoryId)).thenReturn(inventory); when(equipmentMapper.getById(equipmentId)).thenReturn(equipment); when(equipmentTypeMapper.getEquipmentTypeById(equipmentTypeId)).thenReturn(equipmentType); when(equipmentInventoryStatusMapper.getCurrentStatus(inventoryId)).thenReturn(status); EquipmentInventory result = repository.getInventoryById(inventoryId); verify(mapper).getInventoryById(inventoryId); verify(equipmentMapper).getById(equipmentId); verify(equipmentTypeMapper).getEquipmentTypeById(equipmentTypeId); verify(equipmentInventoryStatusMapper).getCurrentStatus(inventoryId); assertEquals(result, inventory); }
public EquipmentInventory getInventoryById(Long id){ EquipmentInventory inventory = mapper.getInventoryById(id); setEquipmentToInventory(inventory); setStatusToInventory(inventory); return inventory; }
EquipmentInventoryRepository { public EquipmentInventory getInventoryById(Long id){ EquipmentInventory inventory = mapper.getInventoryById(id); setEquipmentToInventory(inventory); setStatusToInventory(inventory); return inventory; } }
EquipmentInventoryRepository { public EquipmentInventory getInventoryById(Long id){ EquipmentInventory inventory = mapper.getInventoryById(id); setEquipmentToInventory(inventory); setStatusToInventory(inventory); return inventory; }  }
EquipmentInventoryRepository { public EquipmentInventory getInventoryById(Long id){ EquipmentInventory inventory = mapper.getInventoryById(id); setEquipmentToInventory(inventory); setStatusToInventory(inventory); return inventory; }  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 EquipmentInventory getInventoryById(Long id){ EquipmentInventory inventory = mapper.getInventoryById(id); setEquipmentToInventory(inventory); setStatusToInventory(inventory); return inventory; }  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; }