November 2024
Intermediate to advanced
300 pages
7h 12m
English
You’ll be making several passes through the test, each with a different intent.
A quick scan of the test reveals old-school Java and JUnit, evidenced by the lack of local variable type inferencing and the unnecessary use of public for the class and test method. One of the best things about the newer versions of both Java and JUnit is their ability to simplify your code.
First, make a couple of quick cleanup passes:
Here’s a snippet:
| » | class SearchTest { |
| | @Test |
| » | void testSearch() { |
| | try { |
| | var pageContent = "There are certain ... |
Read now
Unlock full access