CalvalusWpsSpi implements WpsServiceProvider { @Override public WpsServiceInstance createServiceInstance(WpsServerContext wpsServerContext) { try { PropertiesWrapper.loadConfigFile("calvalus-wps.properties"); } catch (IOException exception) { throw new WpsRuntimeException("Unable to load calvalus-wps.properties file", exception); } return new CalvalusWpsProvider(); }  @Override String getId(); @Override String getName(); @Override String getDescription(); @Override WpsServiceInstance createServiceInstance(WpsServerContext wpsServerContext);  }
@Test public void canCreateServiceInstance() throws Exception { PowerMockito.mockStatic(PropertiesWrapper.class); assertThat(calvalusWpsSpi.createServiceInstance(mockWpsServerContext), instanceOf(CalvalusWpsProvider.class)); }
@Test(expected = WpsRuntimeException.class) public void canThrowIOExceptionWhenCreateServiceInstanceNoPropertiesFile() throws Exception { assertThat(calvalusWpsSpi.createServiceInstance(mockWpsServerContext), instanceOf(CalvalusWpsProvider.class)); }