java.lang.AssertionError: Status expected:<404> but was:<406>

  1. 0

    Spring: Returning empty HTTP Responses with ResponseEntity<Void> doesn't work

    Stack Overflow | 2 years ago | ScarOnTheSky
    java.lang.AssertionError: Status expected:<404> but was:<406>
  2. 0

    Unit Test with Mock

    Stack Overflow | 2 years ago
    java.lang.AssertionError: Status expected:<200> but was:<400>
  3. 0

    Mock MVC unexpected result - Code - Help To User

    helptouser.com | 1 year ago
    java.lang.AssertionError: Status expected:<200> but was:<404>
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    Failed test during integTest on spring-io/sagan

    GitHub | 2 years ago | marioja
    java.lang.AssertionError: Status expected:<200> but was:<404>
  6. 0

    Sagan fails to build with 1.1.0, probably due to MVC error handling

    GitHub | 3 years ago | philwebb
    java.lang.AssertionError: Status expected:<404> but was:<500>

  1. tvrmsmith 6 times, last 3 months ago
57 unregistered visitors
Not finding the right solution?
Take a tour to get the most out of Samebug.

Tired of useless tips?

Automated exception search integrated into your IDE

Root Cause Analysis

  1. java.lang.AssertionError

    Status expected:<404> but was:<406>

    at org.springframework.test.util.AssertionErrors.fail()
  2. Spring TestContext
    MockMvc$1.andExpect
    1. org.springframework.test.util.AssertionErrors.fail(AssertionErrors.java:60)
    2. org.springframework.test.util.AssertionErrors.assertEquals(AssertionErrors.java:89)
    3. org.springframework.test.web.servlet.result.StatusResultMatchers$10.match(StatusResultMatchers.java:652)
    4. org.springframework.test.web.servlet.MockMvc$1.andExpect(MockMvc.java:153)
    4 frames
  3. de.zeb.control
    TaxonomyQueryControllerTest.taxonomyPackageDoesNotExist
    1. de.zeb.control.application.xbrlstandalonevalidator.restservice.TaxonomyQueryControllerTest.taxonomyPackageDoesNotExist(TaxonomyQueryControllerTest.java:54)
    1 frame
  4. Java RT
    Method.invoke
    1. sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    2. sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    3. sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    4. java.lang.reflect.Method.invoke(Method.java:606)
    4 frames
  5. TestNG
    RemoteTestNG.main
    1. org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:84)
    2. org.testng.internal.Invoker.invokeMethod(Invoker.java:714)
    3. org.testng.internal.Invoker.invokeTestMethod(Invoker.java:901)
    4. org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1231)
    5. org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:127)
    6. org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:111)
    7. org.testng.TestRunner.privateRun(TestRunner.java:767)
    8. org.testng.TestRunner.run(TestRunner.java:617)
    9. org.testng.SuiteRunner.runTest(SuiteRunner.java:334)
    10. org.testng.SuiteRunner.runSequentially(SuiteRunner.java:329)
    11. org.testng.SuiteRunner.privateRun(SuiteRunner.java:291)
    12. org.testng.SuiteRunner.run(SuiteRunner.java:240)
    13. org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
    14. org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86)
    15. org.testng.TestNG.runSuitesSequentially(TestNG.java:1224)
    16. org.testng.TestNG.runSuitesLocally(TestNG.java:1149)
    17. org.testng.TestNG.run(TestNG.java:1057)
    18. org.testng.remote.RemoteTestNG.run(RemoteTestNG.java:111)
    19. org.testng.remote.RemoteTestNG.initAndRun(RemoteTestNG.java:204)
    20. org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:175)
    20 frames