CalvalusGetCapabilitiesOperation extends WpsOperation { ServiceProvider getServiceProvider() { ServiceProvider serviceProvider = new ServiceProvider(); serviceProvider.setProviderName(PropertiesWrapper.get("company.name")); OnlineResourceType siteUrl = new OnlineResourceType(); siteUrl.setHref(PropertiesWrapper.get("company.website")); serviceProvider.setProviderSite(siteUrl); ResponsiblePartySubsetType contact = new ResponsiblePartySubsetType(); contact.setIndividualName(PropertiesWrapper.get("project.manager.name")); contact.setPositionName(PropertiesWrapper.get("project.manager.position.name")); ContactType contactInfo = new ContactType(); TelephoneType phones = new TelephoneType(); phones.getVoice().add(PropertiesWrapper.get("company.phone.number")); phones.getFacsimile().add(PropertiesWrapper.get("company.fax.number")); contactInfo.setPhone(phones); AddressType address = new AddressType(); address.getDeliveryPoint().add(PropertiesWrapper.get("company.address")); address.setCity(PropertiesWrapper.get("company.city")); address.setAdministrativeArea(PropertiesWrapper.get("company.administrative.area")); address.setPostalCode(PropertiesWrapper.get("company.post.code")); address.setCountry(PropertiesWrapper.get("company.country")); address.getElectronicMailAddress().add(PropertiesWrapper.get("company.email.address")); contactInfo.setAddress(address); contactInfo.setOnlineResource(siteUrl); contactInfo.setHoursOfService(PropertiesWrapper.get("company.service.hours")); contactInfo.setContactInstructions(PropertiesWrapper.get("company.contact.instruction")); contact.setContactInfo(contactInfo); CodeType role = new CodeType(); role.setValue("PointOfContact"); contact.setRole(role); serviceProvider.setServiceContact(contact); return serviceProvider; } CalvalusGetCapabilitiesOperation(WpsRequestContext context); Capabilities getCapabilities();  }
@Test public void canGetServiceProvider() throws Exception { ServiceProvider serviceProvider = getCapabilitiesOperation.getServiceProvider(); assertThat(serviceProvider.getProviderName(), equalTo("Brockmann Consult GmbH")); assertThat(serviceProvider.getProviderSite().getHref(), equalTo("http: assertThat(serviceProvider.getServiceContact().getRole().getValue(), equalTo("PointOfContact")); assertThat(serviceProvider.getServiceContact().getIndividualName(), equalTo("Dr. Martin Boettcher")); assertThat(serviceProvider.getServiceContact().getPositionName(), equalTo("Project Manager")); assertThat(serviceProvider.getServiceContact().getContactInfo().getPhone().getVoice().size(), equalTo(1)); assertThat(serviceProvider.getServiceContact().getContactInfo().getPhone().getVoice().get(0), equalTo("+49 4152 889300")); assertThat(serviceProvider.getServiceContact().getContactInfo().getPhone().getFacsimile().size(), equalTo(1)); assertThat(serviceProvider.getServiceContact().getContactInfo().getPhone().getFacsimile().get(0), equalTo("+49 4152 889333")); assertThat(serviceProvider.getServiceContact().getContactInfo().getAddress().getDeliveryPoint().get(0), equalTo("Max-Planck-Str. 2")); assertThat(serviceProvider.getServiceContact().getContactInfo().getAddress().getCity(), equalTo("Geesthacht")); assertThat(serviceProvider.getServiceContact().getContactInfo().getAddress().getAdministrativeArea(), equalTo("SH")); assertThat(serviceProvider.getServiceContact().getContactInfo().getAddress().getPostalCode(), equalTo("21502")); assertThat(serviceProvider.getServiceContact().getContactInfo().getAddress().getCountry(), equalTo("Germany")); assertThat(serviceProvider.getServiceContact().getContactInfo().getAddress().getElectronicMailAddress().size(), equalTo(1)); assertThat(serviceProvider.getServiceContact().getContactInfo().getAddress().getElectronicMailAddress().get(0), equalTo("info@brockmann-consult.de")); assertThat(serviceProvider.getServiceContact().getContactInfo().getHoursOfService(), equalTo("24x7")); assertThat(serviceProvider.getServiceContact().getContactInfo().getContactInstructions(), equalTo("Don't hesitate to call")); }