JUnit 5 Architecture. Part 5

  1. We declare our CustomStatement class that extends the Statement class (1).
  2. We keep references to a Statement field and to a Description field (2) and we use them as arguments of the constructor (3).
  3. We override the inherited evaluate method and call base.evaluate() inside it (4).
  • We declare a public CustomRule field and we annotate it with @Rule (1).
  • We create the myCustomRuleTest method and annotate it with @Test (2).

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store