Uploaded image for project: 'WildFly Elytron'
  1. WildFly Elytron
  2. ELY-2441

Move the expected exception assertion from an annotation to the test body in DefaultSSLContextEmptyPathTest

XMLWordPrintable

      When testing exceptions using @Test(expected=...) annotation, having additional assertions inside that test method can be problematic because any code after the raised exception will not be executed.

      Move the exception checking from the @Test annotation to the test body in DefaultSSLContextEmptyPathTest, i.e., check that the exception thrown by SSLContext.getDefault is an IllegalArgumentException.

      One way to do this by using Assert#assertThrows.

            leahgarbri Leah Garcia (Inactive)
            fjuma1@redhat.com Farah Juma
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: