Page tree

Skip to end of metadata
Go to start of metadata

This lesson explains how enhance and maintain already created tests

Exercise 1 - Working with Recommendations

  1. Open the jtest-examples> src/main/java> examples.junit> Money class in the editor and click anywhere in the class.
  2. Choose the Add test case(s) action in the UTA interface.

  3. Select the Monedy.addMoneyBag(MoneyBag) method int the dialog opens and click OK.

    This will create the test for the selected method:
  4. Open the jtest-examples> src/test/java> examples.junit> file.
  5. Modify the default UTA values for in the test created for the addMoneyBag() method:
  6. Click Run testAddMoneyBag in the Unit Test Assistant view to execute the test.
  7. View the Recommendations tab for information how you can improve the test. It displays information that the test you've just created should include assertions.
  8. Click
  9. cc

  10. Make assertions
  11. View assertions

  12. Click Run all in the Unit Test Assistant view to run all tests in the MoneyTest class.
  13. More than one recommendation - filter by category.

  14. v
  15. Change

  16. Run

  • No labels