Skip to content

Non-spock tests failing with IllegalArgumentException #11

@M21B8

Description

@M21B8

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:

Stacktrace
java.lang.IllegalArgumentException: MockAttachingTestExecutionListener can be applied only for spock specifications
	at com.pchudzik.springmock.spock.spring.MockAttachingTestExecutionListener.beforeTestMethod(MockAttachingTestExecutionListener.java:48)
	at org.springframework.test.context.TestContextManager.beforeTestMethod(TestContextManager.java:269)
	at org.springframework.test.context.junit4.statements.RunBeforeTestMethodCallbacks.evaluate(RunBeforeTestMethodCallbacks.java:74)
	at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions