java.lang.IllegalStateException: Failed to find 'public static final SpringClassRule' field in test class [com.example.unit.testing.application.PlacingOrderTest$WithExistingCustomer]. Consult the javadoc for SpringClassRule for details.

Searched on Google with the first line of a JAVA stack trace?

We can recommend more relevant solutions and speed up debugging when you paste your entire stack trace with the exception message. Try a sample exception.

Recommended solutions based on your search

Samebug tips

Do you know how to solve this issue? Write a tip to help other users and build your expert profile.

Solutions on the web

via Spring JIRA by Benoit AVERTY, 1 year ago
Failed to find 'public static final SpringClassRule' field in test class [com.example.unit.testing.application.PlacingOrderTest$WithExistingCustomer]. Consult the javadoc for SpringClassRule for details.
via Spring JIRA by Benoit AVERTY, 1 year ago
Failed to find 'public static final SpringClassRule' field in test class [com.example.unit.testing.application.PlacingOrderTest$WithExistingCustomer]. Consult the javadoc for SpringClassRule for details.
java.lang.IllegalStateException: Failed to find 'public static final SpringClassRule' field in test class [com.example.unit.testing.application.PlacingOrderTest$WithExistingCustomer]. Consult the javadoc for SpringClassRule for details.
at org.springframework.test.context.junit4.rules.SpringMethodRule.validateSpringClassRuleConfiguration(SpringMethodRule.java:233)
at org.springframework.test.context.junit4.rules.SpringMethodRule.apply(SpringMethodRule.java:143)
at de.bechte.junit.runners.context.statements.builder.HierarchicalRunRulesStatementBuilder.createStatement(HierarchicalRunRulesStatementBuilder.java:42)
at de.bechte.junit.runners.context.processing.MethodExecutor.run(MethodExecutor.java:80)
at de.bechte.junit.runners.context.processing.MethodExecutor.run(MethodExecutor.java:57)
at de.bechte.junit.runners.context.statements.RunChildren.evaluate(RunChildren.java:38)
at de.bechte.junit.runners.context.statements.RunAll.evaluate(RunAll.java:27)
at de.bechte.junit.runners.context.statements.StatementExecutor.execute(StatementExecutor.java:28)
at de.bechte.junit.runners.context.HierarchicalContextRunner.run(HierarchicalContextRunner.java:134)
at de.bechte.junit.runners.context.processing.ContextExecutor.run(ContextExecutor.java:26)
at de.bechte.junit.runners.context.processing.ContextExecutor.run(ContextExecutor.java:15)
at de.bechte.junit.runners.context.statements.RunChildren.evaluate(RunChildren.java:38)
at de.bechte.junit.runners.context.statements.RunAll.evaluate(RunAll.java:27)
at org.springframework.test.context.junit4.statements.RunBeforeTestClassCallbacks.evaluate(RunBeforeTestClassCallbacks.java:61)
at org.springframework.test.context.junit4.statements.RunAfterTestClassCallbacks.evaluate(RunAfterTestClassCallbacks.java:70)
at org.springframework.test.context.junit4.rules.SpringClassRule$TestContextManagerCacheEvictor.evaluate(SpringClassRule.java:248)
at org.junit.rules.RunRules.evaluate(RunRules.java:20)
at de.bechte.junit.runners.context.statements.StatementExecutor.execute(StatementExecutor.java:28)
at de.bechte.junit.runners.context.HierarchicalContextRunner.run(HierarchicalContextRunner.java:134)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:459)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:675)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382)

Users with the same issue

You are the first who have seen this exception. Write a tip to help other users and build your expert profile.

Write tip

Know the solutions? Share your knowledge to help other developers to debug faster.