Tests should fail only on expected exceptions.
Entity should be saved to database before calling methods that check it.
Actual behavior
There are 26 tests failing unexpectedly.
There are tests that call ownerController.findOwner(<int>), but do not call entityManager.persist(...) before.
Description
OwnerController Integration tests fail on assertions. findOwner tests get Owner by id, but it was not saved in the test method before.
To Reproduce
spring-petclinic
projectIntegration tests
forOwnerController
Expected behavior
Tests should fail only on expected exceptions. Entity should be saved to database before calling methods that check it.
Actual behavior
There are 26 tests failing unexpectedly. There are tests that call
ownerController.findOwner(<int>)
, but do not call entityManager.persist(...) before.Screenshots, logs
This is one of successful tests on findOwner:
Environment
IntelliJ IDEA version - Ultimate 2023.2 Project - spring-petclinic (Gradle) JDK - 17