@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);
}