JUnit 5 Architecture. Part 5
JUnit 5 Architecture. Part 5
In this fifth article in our series we look at the CustomStatement class. Happy reading.
4 черв 2020
1071
Інші статті
How to incrementally migrate the data from RDBMS to Hadoop using Sqoop Incremental Last Modified technique?
How to implement Slowly Changing Dimensions(SCD) Type 2 in Spark?
How to incrementally migrate the data from RDBMS to Hadoop using Sqoop Incremental Append technique?
Why MongoDB don't fetch all the matching documents for the query fired
How to solve the issue of full disk utilization in HDFS Namenode
Can We Use HDFS as Back-up Storage?
How to do Indexing in MongoDB with Elastic Search? Part 1
How to do Indexing in MongoDB with Elastic Search? Part 2
How to store data on browser using NoSQL IndexedDB?
How to Apply MBTI in HR: Motivation for every day. Groups of People & their Motivations
Into listing 7, we do the following:
- We declare our CustomStatement class that extends the Statement class (1).
- We keep references to a Statement field and to a Description field (2) and we use them as arguments of the constructor (3).
- We override the inherited evaluate method and call base.evaluate() inside it (4).
Into listing 8, we use the previously defined CustomRule by doing the following:
- We declare a public CustomRule field and we annotate it with @Rule (1).
- We create the myCustomRuleTest method and annotate it with @Test (2).
The result of the execution of this test is shown in figure 1. The effective execution of the test is surrounded by the additional messages provided into the evaluate method of the CustomStatement class.
Figure 4 The result of the execution of JUnit4CustomRuleTester.
Interested in Java? Check out our trainings.
Catalin Tudose
Java and Web Technologies Expert