Testing

Tests should not only verify the correctness of your code, but also serve as documentation on how the application should behave in different situations.

Tests are functions that verify that the non-test code is functioning in the expected manner. The bodies of test functions typically perform these three actions:

  1. Set up any needed data or state.
  2. Run the code you want to test.
  3. Assert the results are what you expect.

Things to look for in unit tests

  1. test positive scenarios
  2. test negative scenarios
  3. proper assert statements
  4. proper argument captors
  5. proper verify blocks

KNOWLEDGE GAP - LEARN MORE, IMPLEMENT THIS

  1. Junit testing using WireMock: https://wiremock.org/docs/junit-jupiter/
  2. Serenity BDD: https://www.baeldung.com/serenity-bdd
  3. Testing with Hamcrest: https://www.baeldung.com/java-junit-hamcrest-guide
  4. A Guide to REST-assured: https://www.baeldung.com/rest-assured-tutorial
  5. Integration Testing in Spring: https://www.baeldung.com/integration-testing-in-spring
  6. https://www.geeksforgeeks.org/types-software-testing/?ref=leftbar-rightbar
  7. https://www.continuousimprover.com/2015/11/12-tips-to-write-unit-tests-that-dont.html?utm_source=pocket_reader

Tags:

  1. Commands to run tests on individual files
  2. Junit testing
  3. Maven Jacoco Configuration
  4. Mockito
  5. Spock
  6. Spring Boot Testing
  7. Spring Data JPA - testing
  8. Spring Cloud Stream - Testing
  9. Python Testing
  10. GoLang Testing
  11. Postman
  12. Deterministic Simulation Testing