java.lang.IllegalArgumentException

The test method of the supplied TestContext must not be null

Samebug tips1

If you're unit testing, you should instantiate only the service and mock the dependencies. If you're testing integration, you should add all the mocking to the configurations file.

Don't give up yet. Our experts can help. Paste your full stack trace to get a solution.

Solutions on the web27285

  • via Spring JIRA by Andrew Toolan, 11 months ago
    The test method of the supplied TestContext must not be null
  • via Spring JIRA by Andrew Toolan, 1 year ago
    The test method of the supplied TestContext must not be null
  • The value of property bind.address must not be null
  • Stack trace

    • java.lang.IllegalArgumentException: The test method of the supplied TestContext must not be null at org.springframework.util.Assert.notNull(Assert.java:115) at org.springframework.test.context.support.AbstractDirtiesContextTestExecutionListener.beforeOrAfterTestMethod(AbstractDirtiesContextTestExecutionListener.java:95) at org.springframework.test.context.support.DirtiesContextBeforeModesTestExecutionListener.beforeTestMethod(DirtiesContextBeforeModesTestExecutionListener.java:95) at org.springframework.test.context.TestContextManager.beforeTestMethod(TestContextManager.java:265) at org.springframework.test.context.junit4.statements.RunBeforeTestMethodCallbacks.evaluate(RunBeforeTestMethodCallbacks.java:74) at org.springframework.test.context.junit4.statements.RunAfterTestMethodCallbacks.evaluate(RunAfterTestMethodCallbacks.java:86) at org.springframework.test.context.junit4.statements.RunPrepareTestInstanceCallbacks.evaluate(RunPrepareTestInstanceCallbacks.java:64) at org.springframework.test.context.junit4.statements.SpringRepeat.evaluate(SpringRepeat.java:84) at org.springframework.test.context.junit4.statements.SpringFailOnTimeout.evaluate(SpringFailOnTimeout.java:87) at org.springframework.test.context.junit4.statements.ProfileValueChecker.evaluate(ProfileValueChecker.java:103) at com.ibm.toscana.util.junit.repeat.RunRepeatedly.evaluateStatement(RunRepeatedly.java:55) at com.ibm.toscana.util.junit.repeat.RunRepeatedly.evaluate(RunRepeatedly.java:34) at org.junit.rules.RunRules.evaluate(RunRules.java:20) at org.junit.experimental.theories.Theories$TheoryAnchor$1$1.evaluate(Theories.java:232) at org.junit.experimental.theories.Theories$TheoryAnchor.runWithCompleteAssignment(Theories.java:218) at org.junit.experimental.theories.Theories$TheoryAnchor.runWithAssignment(Theories.java:204) at com.ibm.toscana.util.junit.runner.ToscanaRunner$ParallelTheoryAnchor.runWithAssignment(ToscanaRunner.java:70) at org.junit.experimental.theories.Theories$TheoryAnchor.evaluate(Theories.java:187) at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57) at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290) at java.util.concurrent.ForkJoinTask$AdaptedRunnableAction.exec(ForkJoinTask.java:1397) at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:300) at java.util.concurrent.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1067) at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1703) at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:168)

    Write tip

    You have a different solution? A short tip here would help you and many other users who saw this issue last week.

    Users with the same issue

    Unknown user
    Once, 1 month ago
    Unknown user
    Once, 1 month ago
    18 times, 1 month ago
    16 times, 1 month ago
    Once, 2 months ago
    190 more bugmates