fuzzydb
fuzzydb copied to clipboard
Create Spring mock: namespace support
Start with the following.
test scope: <mocks:mockito /> - confirm on classpath runtime scope: <mocks: stubs /> generates mocks
<mocks:mock id="blah" interface="com.wwm...." type="stub" />
<mocks:spy /> (if possible)
Feature toggles would be good to
HttpInvokerProxyFactoryBean woudl be good example for type = stub
public void afterPropertiesSet() {
super.afterPropertiesSet();
if (getServiceInterface() == null) {
throw new IllegalArgumentException("Property 'serviceInterface' is required");
}
this.serviceProxy = new ProxyFactory(getServiceInterface(), this).getProxy(getBeanClassLoader());
}
Gives us a proxy that calls this.invoke(MethodInvocation), as defined by MethodInterceptor interface.
At that point we can return the relevant stub value.