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