You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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)
The text was updated successfully, but these errors were encountered:
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
The text was updated successfully, but these errors were encountered: