Search in sources :

Example 31 with Organization

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

the class OrganizationRepositoryTest method testOrganizationSaveAndFind.

@Test
public void testOrganizationSaveAndFind() {
    final Organization foundOrg = organizationRepository.findOne(ORG_ID);
    Assert.assertNotNull(foundOrg);
    final Organization foundOrg2 = organizationRepository.findByIdOrNameAndTypes(ORG_ID, Organization.OrganizationType.procuringEntity);
    Assert.assertNotNull(foundOrg2);
    final Organization foundOrg3 = organizationRepository.findByIdOrNameAndTypes(ORG_ID, Organization.OrganizationType.supplier);
    Assert.assertNull(foundOrg3);
    final Organization foundOrg4 = organizationRepository.findByIdOrNameAllIgnoreCase(ORG_ID, ORG_ID);
    Assert.assertNotNull(foundOrg4);
}
Also used : Organization(org.devgateway.ocds.persistence.mongo.Organization) Test(org.junit.Test) AbstractMongoTest(org.devgateway.toolkit.persistence.mongo.AbstractMongoTest)

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