fuzzydb icon indicating copy to clipboard operation
fuzzydb copied to clipboard

Create Spring mock: namespace support

Open nealeu opened this issue 14 years ago • 1 comments

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

nealeu avatar Nov 09 '11 11:11 nealeu

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.

nealeu avatar Nov 09 '11 11:11 nealeu