use of org.devgateway.ocds.persistence.mongo.Address in project ocvn by devgateway.
the class OrganizationRepositoryTests method saveOrganization.
@Test
public void saveOrganization() {
Organization o = new Organization();
Address a = new Address();
a.setCountryName("United States");
a.setLocality("Washington");
a.setRegion("DC");
a.setPostalCode("20005");
a.setStreetAddress("1110 Vermont Ave. NW, Suite 500");
o.setAddress(a);
ContactPoint cp = new ContactPoint();
cp.setEmail("info@developmentgateway.org");
cp.setName("John Doe");
cp.setTelephone("555-1234567");
cp.setUrl("http://developmentgateway.org");
cp.setFaxNumber("555-7654321");
o.setContactPoint(cp);
Identifier i = new Identifier();
i.setId("DG");
i.setLegalName("Development Gateway");
o.setIdentifier(i);
o.getRoles().add(OrganizationType.procuringEntity);
o.getAdditionalIdentifiers().add(i);
Organization save = vnOrganizationRepository.save(o);
assertThat(save.getId(), is(not(nullValue())));
LOGGER.info(save.getId());
}
use of org.devgateway.ocds.persistence.mongo.Address in project ocvn 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");
contactPoint.setUrl("http://developmentgateway.org");
organization.setContactPoint(contactPoint);
final Identifier identifier = new Identifier();
identifier.setId(ORG_ID);
organization.getAdditionalIdentifiers().add(identifier);
organization.getRoles().add(Organization.OrganizationType.procuringEntity);
organization.getRoles().add(Organization.OrganizationType.buyer);
final Organization savedOrganization = organizationRepository.save(organization);
Assert.assertNotNull(savedOrganization);
Assert.assertEquals(ORG_ID, savedOrganization.getId());
}
use of org.devgateway.ocds.persistence.mongo.Address in project ocvn by devgateway.
the class OrganizationRepositoryTest method importTestData.
@Before
public void importTestData() throws IOException, InterruptedException {
// be sure that the organization collection is empty
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");
contactPoint.setUrl("http://developmentgateway.org");
organization.setContactPoint(contactPoint);
final Identifier identifier = new Identifier();
organization.getAdditionalIdentifiers().add(identifier);
organization.getRoles().add(Organization.OrganizationType.procuringEntity);
organization.getRoles().add(Organization.OrganizationType.buyer);
final Organization savedOrganization = organizationRepository.save(organization);
Assert.assertNotNull(savedOrganization);
Assert.assertEquals(ORG_ID, savedOrganization.getId());
}
use of org.devgateway.ocds.persistence.mongo.Address in project ocvn by devgateway.
the class OrganizationRowImporter method newAddress.
protected void newAddress(Organization organization, String addressCell) {
Address address = new Address();
address.setStreetAddress(addressCell);
organization.setAddress(address);
}
Aggregations