Skip to content

Instantly share code, notes, and snippets.

@eliasnogueira
Last active April 12, 2024 06:02
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save eliasnogueira/69ea4f5907d582de4ba6ee6b36ad2186 to your computer and use it in GitHub Desktop.
Save eliasnogueira/69ea4f5907d582de4ba6ee6b36ad2186 to your computer and use it in GitHub Desktop.
Modern Testing Tools for Java Developers - Project links

Links

AssertJ examples

Custom Assertion

REST-Assured

Basic one (don’t scale)

Intermediate one

Scalable one

Awaitability

How to to see, locally, the delay in the database insertion​

  • Use the event-source branch
  • Start the application
  • Login to H2 (sa/password)
  • Run a query into the EVENT_SOURCE table
  • Make a POST request (you can use the Swagger UI)
  • Run a query into the EVENT_SOURCE table
  • The insertion will occur only 7 seconds after the request

Running the example

  • Test class: EventTest
  • Run the checkEventWithRestriction_Fail() and see it failing because of the 7 second's delay
  • Run the checkEventWithRestriction_Success() and see the test green

Disclaimer

There’s no asynchronous system here. A delay of 7 seconds was added in the EventService that will be called by the RestrictionController methods and SimulationsController for the POST and DELETE methods.

WireMock

General explanation

Projects

@rcardosopereira
Copy link

Muito bom. Parabens pelas informações aqui. Obrigado

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment