Details
Description
Spring's Java-driven application context configuration mechanism "@Configuration" could be used to simplify system tests by abstracting the creation and configuration of client proxies.
Spring 3.1 and later ships with a suite of @Enable* annotations that drive the registration of infrastructure beans within the application context. For example, @EnableWebMvc configures the application context with the relevant beans for Spring MVC. The @Enable* annotations are equivalent Spring bean configuration namespace registrations such as <mvc:annotation-driven/>.
A @EnableCxfRsClientProxy could be employed to simplify the creation and configuration of a single test client proxy:
public class MyIntegrationTest { @EnableCxfRsClientProxy @Configuration static class ConfigureFooClientProxy extends CxfRsClientProxyAdapter { @Override public Class<?> getServiceType { return FooService.class; } } @Autowired private FooService clientProxy; @Test public void should() { } }
Attachments
Issue Links
- relates to
-
CXF-5495 JAX-RS Spring integration via Configuration annotation
- Closed