Enable developers to write Component tests

Description

We have the general tools (JUnit, RestAssured, RestTemplate, Mockito, etc), now we need to put these together to enable Component tests to be written (see testing guide).

Acceptance criteria:

  • Build test double for the typical requests the services make to Auth - e.g. allow tests to be written where any auth request is approved, alternatively allow tests to be written where every auth request returns a not-approved. This will be the example other test-doubles will follow technically. Auth will not be running and nothing will be going over the wire. Allow tests to start in spring context that will use this test double (and later for other services)

  • Take a RESTful endpoint, send JSON to it, Mock out all external service calls (no need to mock postgres or logging). Test controller actions and responses: that a call to auth was made, that serialization/deserialization was successful, that malformed entries return the correct HTTP status and body, etc....

  • Component tests have their own gradle task so they may be run independently of other tests, and Gradle's "check" task runs it after integration tests by default.

Assignee

Chongsun Ahn

Reporter

Josh Zamor

Labels

Components

Sprint

None

Fix versions

Priority

Major
Configure