@Test public void test_should_set_department_id_to_seva_request() { final String designationId = "designationId"; final String departmentId = "departmentId"; final String tenantId = "tenantId"; when(sevaRequest.getTenantId()).thenReturn(tenantId); final long assigneeId = 2L; when(sevaRequest.getCurrentPositionId()).thenReturn(assigneeId); final Position position = new Position(designationId, departmentId); when(positionRepository.getDesignationIdForAssignee(tenantId, assigneeId)).thenReturn(position); positionService.enrichRequestWithPosition(sevaRequest); verify(sevaRequest).update(position); }
public void enrichRequestWithPosition(SevaRequest sevaRequest) { final Position position = positionRepository .getDesignationIdForAssignee(sevaRequest.getTenantId(), sevaRequest.getCurrentPositionId()); sevaRequest.update(position); }
PositionService { public void enrichRequestWithPosition(SevaRequest sevaRequest) { final Position position = positionRepository .getDesignationIdForAssignee(sevaRequest.getTenantId(), sevaRequest.getCurrentPositionId()); sevaRequest.update(position); } }
PositionService { public void enrichRequestWithPosition(SevaRequest sevaRequest) { final Position position = positionRepository .getDesignationIdForAssignee(sevaRequest.getTenantId(), sevaRequest.getCurrentPositionId()); sevaRequest.update(position); } PositionService(PositionRepository positionRepository); }
PositionService { public void enrichRequestWithPosition(SevaRequest sevaRequest) { final Position position = positionRepository .getDesignationIdForAssignee(sevaRequest.getTenantId(), sevaRequest.getCurrentPositionId()); sevaRequest.update(position); } PositionService(PositionRepository positionRepository); void enrichRequestWithPosition(SevaRequest sevaRequest); }
PositionService { public void enrichRequestWithPosition(SevaRequest sevaRequest) { final Position position = positionRepository .getDesignationIdForAssignee(sevaRequest.getTenantId(), sevaRequest.getCurrentPositionId()); sevaRequest.update(position); } PositionService(PositionRepository positionRepository); void enrichRequestWithPosition(SevaRequest sevaRequest);  }