Spring integration test fails on entityManager.flush()
before call to method under test
#2628
Labels
comp-codegen
Issue is related to code generator
comp-instrumented-process
Issue is related to Instrumented process
comp-spring
Issue is related to Spring projects support
ctg-bug
Issue is a bug
Description
Spring integration test fails with
org.hibernate.TransientObjectException
onentityManager.flush()
before call to method under test.We need to consider executing
entityManager.flush()
during concrete execution, also if@Transactional
is used we should also probably callentityManager.flush()
before and after method under test to ensure database is kept in the consistent state.To Reproduce
Generate integration tests for
UserController.getContacts()
fromMedical-Web-App/develop-new
project withMedicalWebApp
configuration.Environment
Setup environment as described in the Local Development section of the
Medical-Web-App
project README.Expected behavior
No test fails with exception before reaching method under test call.
Actual behavior
There's a test that fails with
org.hibernate.TransientObjectException
onentityManager.flush()
before call to method under test.Visual proofs (screenshots, logs, images)
The text was updated successfully, but these errors were encountered: