re: Java vs Go: Impressive solutions for invented problems VIEW POST


Unit tests should be independent of each other. aren't they?


99.99% of the time yes.

I was thinking more in the lines of an integration test, where you would like to test a more complex workflow, e.g.:

  1. Test the login endpoint, and in case of success, capture the token for example and store it for later
  2. Using the token captured in 1., test a GET /documents endpoint, and assert that the response is empty
  3. Using the token, test POST /documents endpoint and assert that the response is 201, and capture/store the created document id
  4. test GET /documents a second time and ensure that the created document appears there
Code of Conduct Report abuse