Camel
  1. Camel
  2. CAMEL-5983

Avoid the negative-tests to behave as false-positive

    Details

    • Type: Task Task
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.10.3
    • Fix Version/s: 2.10.4, 2.11.0
    • Component/s: tests
    • Labels:
      None
    • Estimated Complexity:
      Unknown

      Description

      We've got bunch of (negative) tests on the current codebase expecting a thrown XYZException however they don't realize if the expected exception is not thrown, the typical pattern for this is:

      try {
       doSomething_With_Expectation_Of_A_Thrown_XYZException();
      } catch (XYZException e) {
       // expected
      }
      

      Which correctly should be:

      try {
       doSomething_With_Expectation_Of_A_Thrown_XYZException();
       fail("Should have thrown an exception");
      } catch (XYZException e) {
       // expected
      }
      

        Activity

          People

          • Assignee:
            Babak Vahdat
            Reporter:
            Babak Vahdat
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development