Search in sources :

Example 21 with Organization

use of org.devgateway.ocds.persistence.mongo.Organization in project ocvn by devgateway.

the class OrganizationEndpointsTest method testSupplierIdEndpoint.

@Test
public void testSupplierIdEndpoint() {
    final Organization organizationId = supplierSearchController.byId(ORG_ID);
    Assert.assertNull(organizationId);
}
Also used : Organization(org.devgateway.ocds.persistence.mongo.Organization) Test(org.junit.Test) AbstractWebTest(org.devgateway.toolkit.web.AbstractWebTest)

Example 22 with Organization

use of org.devgateway.ocds.persistence.mongo.Organization in project ocvn by devgateway.

the class OrganizationEndpointsTest method testProcuringEntityIdEndpoint.

@Test
public void testProcuringEntityIdEndpoint() {
    final Organization organizationId = procuringEntitySearchController.byId(ORG_ID);
    Assert.assertNotNull(organizationId);
}
Also used : Organization(org.devgateway.ocds.persistence.mongo.Organization) Test(org.junit.Test) AbstractWebTest(org.devgateway.toolkit.web.AbstractWebTest)

Example 23 with Organization

use of org.devgateway.ocds.persistence.mongo.Organization in project ocvn by devgateway.

the class OrganizationEndpointsTest method testProcuringEntitySearchText.

@Test
public void testProcuringEntitySearchText() {
    final TextSearchRequest osr = new TextSearchRequest();
    osr.setText("Development");
    final List<Organization> organizations = procuringEntitySearchController.searchText(osr);
    Assert.assertEquals(1, organizations.size(), 0);
}
Also used : TextSearchRequest(org.devgateway.ocds.web.rest.controller.request.TextSearchRequest) Organization(org.devgateway.ocds.persistence.mongo.Organization) Test(org.junit.Test) AbstractWebTest(org.devgateway.toolkit.web.AbstractWebTest)

Example 24 with Organization

use of org.devgateway.ocds.persistence.mongo.Organization in project oc-explorer by devgateway.

the class OrganizationEndpointsTest method importTestData.

@Before
public void importTestData() throws IOException, InterruptedException {
    organizationRepository.deleteAll();
    final Organization organization = new Organization();
    organization.setName("Development Gateway");
    organization.setId(ORG_ID);
    final Address address = new Address();
    address.setCountryName("Romania");
    address.setLocality("Bucuresti");
    address.setPostalCode("022671");
    address.setRegion("Bucuresti");
    address.setStreetAddress("7 Sos. Iancului");
    organization.setAddress(address);
    final ContactPoint contactPoint = new ContactPoint();
    contactPoint.setEmail("mpostelnicu@developmentgateway.org");
    contactPoint.setFaxNumber("01234567");
    contactPoint.setTelephone("01234567");
    try {
        contactPoint.setUrl(new URI("http://developmentgateway.org"));
    } catch (URISyntaxException e) {
        e.printStackTrace();
    }
    organization.setContactPoint(contactPoint);
    final Identifier identifier = new Identifier();
    identifier.setId(ORG_ID);
    organization.getAdditionalIdentifiers().add(identifier);
    organization.getRoles().add(Organization.OrganizationType.procuringEntity.toString());
    organization.getRoles().add(Organization.OrganizationType.buyer.toString());
    final Organization savedOrganization = organizationRepository.save(organization);
    Assert.assertNotNull(savedOrganization);
    Assert.assertEquals(ORG_ID, savedOrganization.getId());
}
Also used : ContactPoint(org.devgateway.ocds.persistence.mongo.ContactPoint) Organization(org.devgateway.ocds.persistence.mongo.Organization) Identifier(org.devgateway.ocds.persistence.mongo.Identifier) Address(org.devgateway.ocds.persistence.mongo.Address) URISyntaxException(java.net.URISyntaxException) URI(java.net.URI) Before(org.junit.Before)

Example 25 with Organization

use of org.devgateway.ocds.persistence.mongo.Organization in project oc-explorer by devgateway.

the class OrganizationEndpointsTest method testBuyerIdEndpoint.

@Test
public void testBuyerIdEndpoint() {
    final Organization organizationId = buyerSearchController.byId(ORG_ID);
    Assert.assertNotNull(organizationId);
}
Also used : Organization(org.devgateway.ocds.persistence.mongo.Organization) Test(org.junit.Test) AbstractWebTest(org.devgateway.toolkit.web.AbstractWebTest)

Aggregations

Organization (org.devgateway.ocds.persistence.mongo.Organization)31 Test (org.junit.Test)20 AbstractWebTest (org.devgateway.toolkit.web.AbstractWebTest)17 Identifier (org.devgateway.ocds.persistence.mongo.Identifier)7 Address (org.devgateway.ocds.persistence.mongo.Address)5 ContactPoint (org.devgateway.ocds.persistence.mongo.ContactPoint)5 TextSearchRequest (org.devgateway.ocds.web.rest.controller.request.TextSearchRequest)5 OrganizationSearchRequest (org.devgateway.ocds.web.rest.controller.request.OrganizationSearchRequest)4 Before (org.junit.Before)4 URI (java.net.URI)3 Amount (org.devgateway.ocds.persistence.mongo.Amount)3 Release (org.devgateway.ocds.persistence.mongo.Release)3 VNTender (org.devgateway.ocvn.persistence.mongo.dao.VNTender)3 AbstractMongoTest (org.devgateway.toolkit.persistence.mongo.AbstractMongoTest)3 URISyntaxException (java.net.URISyntaxException)2 Detail (org.devgateway.ocds.persistence.mongo.Detail)2 VNAward (org.devgateway.ocvn.persistence.mongo.dao.VNAward)2 VNTendererOrganization (org.devgateway.ocvn.persistence.mongo.dao.VNTendererOrganization)2 DBObject (com.mongodb.DBObject)1 Serializable (java.io.Serializable)1