@Test public void shouldGetById() throws Exception { Equipment equipment = new Equipment(); equipment.setName("Name"); when(mapper.getById(1L)).thenReturn(equipment); Equipment result = repository.getById(1L); verify(mapper).getById(1L); assertEquals(result, equipment); }
public Equipment getById(Long id){ return mapper.getById(id); }
EquipmentRepository { public Equipment getById(Long id){ return mapper.getById(id); } }
EquipmentRepository { public Equipment getById(Long id){ return mapper.getById(id); }  }
EquipmentRepository { public Equipment getById(Long id){ return mapper.getById(id); }  Equipment getById(Long id); List<Equipment> getAll(); List<Equipment> getAllByType(Long equipmentTypeId); List<Equipment> getByType(Long equipmentTypeId, Pagination page); Integer getCountByType(Long equipmentTypeId); List<EquipmentType> getTypesByProgram(Long programId); void insert(Equipment equipment); void update(Equipment equipment); void remove(Long id); }
EquipmentRepository { public Equipment getById(Long id){ return mapper.getById(id); }  Equipment getById(Long id); List<Equipment> getAll(); List<Equipment> getAllByType(Long equipmentTypeId); List<Equipment> getByType(Long equipmentTypeId, Pagination page); Integer getCountByType(Long equipmentTypeId); List<EquipmentType> getTypesByProgram(Long programId); void insert(Equipment equipment); void update(Equipment equipment); void remove(Long id);  }