Skip to content

Latest commit

 

History

History
42 lines (30 loc) · 1.78 KB

File metadata and controls

42 lines (30 loc) · 1.78 KB

Refactoring integration tests in an example REST service with a REST dependency

Familiarize yourself with this service

sequence diagram

Check tests.

Refactor tests

  1. Run tests ./gradlew --rerun-tasks :part2.2-rest:test :part2.2-rest:createTestsExecutionReport --continue
  2. Check reports
  3. Enable parallel execution (in SpockConfig.groovy)
  4. Run tests ./gradlew --rerun-tasks :part2.2-rest:test :part2.2-rest:createTestsExecutionReport --continue
  5. Temporarily disable test retry email fetching after error response ... - add @Ignore annotation to method containing this test.
  6. Temporarily disable test retry email sending after error response ... - add @Ignore annotation to method containing this test.
  7. Temporarily disable tests in SendEmailResourceTest class - add @Ignore annotation this class.
  8. Determine and remove shared state.
  9. Remove @Ignore from retry email fetching after error response ... and fix tests.
  10. Remove @Ignore from retry email sending after error response ... and fix tests.
  11. Remove @Ignore from SendEmailResourceTest class and fix tests.

Shared state

  • stubs regarding REST dependency used in many tests (Wiremock state)

What to check?

Stateful Behaviour

One test is ignored. It uses scenarios. Read about stateful behaviour and scenarios. Enable this test and fix


home