Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create Spring mock: namespace support #78

Open
nealeu opened this issue Nov 9, 2011 · 1 comment
Open

Create Spring mock: namespace support #78

nealeu opened this issue Nov 9, 2011 · 1 comment

Comments

@nealeu
Copy link
Member

nealeu commented Nov 9, 2011

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
Copy link
Member Author

nealeu commented Nov 9, 2011

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant