SpringWSEndpointOrchestrator implements WebSocketDeploymentStatusProvider { public void deployEndpoints() { if (!status.compareAndSet(DeploymentStatus.NOT_PERFORMED, DeploymentStatus.RUNNING)) { throw new IllegalStateException("Deployment already initiated (status: " + status.get() + ")."); } DeploymentStatus deploymentOutcome = performDeployment(); assert deploymentOutcome == DeploymentStatus.SUCCESS || deploymentOutcome == DeploymentStatus.ABORTED; status.set(deploymentOutcome); } SpringWSEndpointOrchestrator(ClassNameResolver clsResolver, ServletContext servletCtx, ApplicationContext
            appCtx, Map<String, Class<?>> endpointMappings); void deployEndpoints(); @Nonnull DeploymentStatus getDeploymentStatus(); final static String SERVLET_CONTAINER_CLASS; }
@Test public void configurationShouldCreateEndpointInstanceThroughAppContext() throws InstantiationException { ClassNameResolver classNameResolver = new TestClassNameResolver().knownClass(ServerContainer.class.getName()); TestServletContext servletCtx = new TestServletContext(); TestServerContainer serverContainer = new TestServerContainer(); servletCtx.setAttribute(SpringWSEndpointOrchestrator.SERVLET_CONTAINER_CLASS, serverContainer); TestApplicationContext appContext = new TestApplicationContext(); appContext.registerBean(DummyEndpoint.class); appContext.refresh(); SpringWSEndpointOrchestrator orchestrator = new SpringWSEndpointOrchestrator(classNameResolver, servletCtx, appContext, mapOf(pair("/dummy_endpoint", DummyEndpoint.class))); orchestrator.deployEndpoints(); ServerEndpointConfig config = serverContainer.getDeployedConfigurations().get(0); DummyEndpoint endpoint = appContext.getBean(DummyEndpoint.class); assertThat(config.getConfigurator().getEndpointInstance(DummyEndpoint.class)).isSameAs(endpoint); }