Skip to content
This repository has been archived by the owner on Jul 26, 2021. It is now read-only.

Latest commit

 

History

History
20 lines (14 loc) · 643 Bytes

README.md

File metadata and controls

20 lines (14 loc) · 643 Bytes

TipAssert example

Create a pet and then as a side effect perform assertion on mutated database by fetching the state and checking the correct name was written.

Note how we run assertions on a separate thread pool assertionExecutionContext to be extra safe:

TipAssert(
  PetService.getPetName(petId)(assertionExecutionContext), // Note how we are using dedicated thread pool here just to be extra safe
  (actualName: String) => actualName == expectedPet.name,
  s"Failed to create pet $petId with correct name! Expected: $expectedPet",
  max = 3,
  delay = Duration(250, TimeUnit.MILLISECONDS)
)

Run with sbt run.