-
Notifications
You must be signed in to change notification settings - Fork 4
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
Non-spock tests failing with IllegalArgumentException #11
Comments
You can check if latest snapshot version will work for you (it probably will not, it might fix the error but you'll probably hit more complicated issues later). I've refactored the check that was raising the exception. It doesn't make any sense and I didn't considered that someone might use spock and junit at the same time, although I did it myself :) The problem might a bit more complicated that it looks. Right now mockito and spock infrastructure are completely different and separated things. Each one setups some stuff, and as a results one will overwrite beans registered by another. For example double factory might get overwritten and as a result you can end up with spock mocks in junit test case. if that's the case then you'll need to do some coding to get this running
and very similar one for spock but use com.pchudzik.springmock.spock.spring.SpockContextCustomizerFactory instead of MockitoContextCustomizerFactory. You can try and figure out the single class which will do it more dynamically but I'm sure you get the idea. Now about long term solution. How should it look? I see few options here but I'm not sure which one will the best.
|
The 1.1.0-SNAPSHOT actually works for us, all our tests pass once I use that version :) Any chance of it becoming a release version? Thanks |
I've just released version 1.1.0 to maven central. Since it's working for you then I'm closing this one. In case of any further issues do not hesitate to reopen. |
My project has a large mix of Spock and Junit tests, the spock tests use a mix of Mockito and Spock mocks, the JUnit tests just use Mockito, since adding this library all of my non spock tests fail with the following error:
Is there anyway to globally turn the listener off, and only add it to the tests where I'm making use of the library? (until such time as I can actually convert the whole code base)
The text was updated successfully, but these errors were encountered: