Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revisionBoth sides next revision
student:junit:v5 [2020/04/23 11:25] – [Testing Methods that Throw Exceptions] changing order, add sub-headings for convenient deep linking stewarmcstudent:junit:v5 [2021/01/19 11:20] bernstdh
Line 147: Line 147:
  
  
-There are several ways to test for thrown exceptions in JUnit. The most common is to use the ''%%assertThrows()%%'' method, but this approach depends on feature of Java (and many languages called [[https://docs.oracle.com/javase/tutorial/java/javaOO/lambdaexpressions.html|"lambda expressions"]], so we will demonstrate a less commonly used approach first.+There are several ways to test for thrown exceptions in JUnit. The most common is to use the ''%%assertThrows()%%'' method, but this approach depends on an advanced feature of Java (and many languagescalled [[https://docs.oracle.com/javase/tutorial/java/javaOO/lambdaexpressions.html|"lambda expressions"]], so we will demonstrate a less commonly used, but simpler, approach first.
  
 === Testing for exceptions === === Testing for exceptions ===