Uploaded image for project: 'Maven Surefire'
  1. Maven Surefire
  2. SUREFIRE-1328

Test should throw ClassCastException but doesn't

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Not A Problem
    • Affects Version/s: 2.19.1
    • Fix Version/s: None
    • Labels:
      None
    • Environment:
      Windows and Linux (Ubuntu 14.04); Java 1.8.0 111 and 112 x64; junit 4.12; mockito 2.6.8; assertj 3.6.2

      Description

      When using argument captor together with assertThat::isInstanceOf in the example code that is provided an ClassCastException is expected. This behavior can be seen when running the test from command line and as well from Intellij which uses surefire plugin. However this code behaves predictably in Eclipse since it has its own test executor.

        Attachments

        1. testThatActualFails_eclipes.png
          18 kB
          Ossian Petri
        2. test_eclipes.png
          17 kB
          Ossian Petri
        3. 2017-04-10 13_09_48-surefireBug.jpg
          48 kB
          Tibor Digana
        4. surefireBug.zip
          21 kB
          Ossian Petri

          Activity

            People

            • Assignee:
              tibordigana Tibor Digana
              Reporter:
              Sywor Ossian Petri
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: