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

Null Pointer exception when names don't match up #15

Closed
M21B8 opened this issue Sep 7, 2017 · 2 comments
Closed

Null Pointer exception when names don't match up #15

M21B8 opened this issue Sep 7, 2017 · 2 comments

Comments

@M21B8
Copy link

M21B8 commented Sep 7, 2017

If the mocks variable name doesn't match the bean name, it can't find the bean to mock, and it falls over with a NPE. I can get round it by making the names match, but seems a bit inflexible.

for example:
@AutowiredSpy ProjectionService spy

java.lang.NullPointerException
	at org.spockframework.mock.MockUtil.asMock(MockUtil.java:54)
	at org.spockframework.mock.MockUtil.attachMock(MockUtil.java:68)
	at com.pchudzik.springmock.spock.spring.MockAttachingTestExecutionListener.beforeTestMethod(MockAttachingTestExecutionListener.java:59)
pchudzik added a commit that referenced this issue Sep 11, 2017
pchudzik added a commit that referenced this issue Sep 12, 2017
@pchudzik
Copy link
Owner

should work better in latest snapshot. 1.1.1-SNAPSHOT.
Will release it soon.

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

2 participants