package org.acme; import static org.acme.jaxws.stubs.StatelessStub.*; import static org.gcube.common.clients.stubs.jaxws.StubFactory.*; import static org.junit.Assert.*; import java.net.URI; import org.acme.jaxws.stubs.StatelessStub; import org.gcube.common.clients.stubs.jaxws.handlers.HandlerRegistry; import org.gcube.common.mycontainer.Deployment; import org.gcube.common.mycontainer.Gar; import org.gcube.common.mycontainer.MyContainerTestRunner; import org.gcube.common.scope.api.ScopeProvider; import org.junit.BeforeClass; import org.junit.Test; import org.junit.runner.RunWith; @RunWith(MyContainerTestRunner.class) public class ConfigTest { @Deployment static Gar testservice = new Gar("test-service").addConfigurations("src/test/resources/test-service/etc").addInterfaces("src/test/resources/test-service/wsdl"); static StatelessStub stub; @BeforeClass public static void setup() { ScopeProvider.instance.set("/gcube/devsec"); stub = stubFor(stateless).at(URI.create("http://localhost:9999/wsrf/services/acme/service/stateless")); } @Test public void handlerTest() { TestHandler handler = new TestHandler(); assertTrue(HandlerRegistry.handlers().contains(handler)); String input = "input"; String output = stub.foo(input); assertEquals(input, output); handler.called=true; assertTrue(HandlerRegistry.handlers().contains(handler)); } }