Search in sources :

Example 11 with Organization

use of org.openlmis.stockmanagement.domain.sourcedestination.Organization in project openlmis-stockmanagement by OpenLMIS.

the class SourceDestinationBaseServiceTest method mockedOrganizationNode.

private Node mockedOrganizationNode(String name) {
    Organization organization = new Organization();
    organization.setName(name);
    organization.setId(randomUUID());
    when(organizationRepository.findOne(organization.getId())).thenReturn(organization);
    Node node = new Node();
    node.setRefDataFacility(false);
    node.setId(randomUUID());
    node.setReferenceId(organization.getId());
    return node;
}
Also used : Organization(org.openlmis.stockmanagement.domain.sourcedestination.Organization) Node(org.openlmis.stockmanagement.domain.sourcedestination.Node)

Aggregations

Organization (org.openlmis.stockmanagement.domain.sourcedestination.Organization)11 Test (org.junit.Test)8 ResultActions (org.springframework.test.web.servlet.ResultActions)6 UUID (java.util.UUID)2 UUID.randomUUID (java.util.UUID.randomUUID)2 ValidSourceDestinationDto (org.openlmis.stockmanagement.dto.ValidSourceDestinationDto)2 Node (org.openlmis.stockmanagement.domain.sourcedestination.Node)1 ValidDestinationAssignment (org.openlmis.stockmanagement.domain.sourcedestination.ValidDestinationAssignment)1 ValidSourceAssignment (org.openlmis.stockmanagement.domain.sourcedestination.ValidSourceAssignment)1 PermissionMessageException (org.openlmis.stockmanagement.exception.PermissionMessageException)1 Message (org.openlmis.stockmanagement.util.Message)1 ResponseEntity (org.springframework.http.ResponseEntity)1 RequestMapping (org.springframework.web.bind.annotation.RequestMapping)1