Closed TheAmg closed 1 month ago
This is resolved when annotation @JsonManagedReference
and @JsonBackReference
are used. Though they should not be used from Jackson's main package com.fasterxml.jackson.annotation
and instead be imported from selogger.com.fasterxml.jackson.annotation
package.
Describe the bug
On checking the serialized value for mocks generated a "failed to serialize trace ..." will be it's value instead of the expected value. The service level mocks are generated correctly. Mock on repo level is the only thing that breaks.
Can be recreated on -
https://github.com/dguduguntla/spring-jpa-lazyload
DepartmentServiceImpl
getAllDepartments
Direct Invoke the above method, check the mock generated for the repo call.
Reproduction steps
(1st start) https://drive.google.com/file/d/1NG9jq7xuNfp9iAayoW1V1Q2ApiZdCjU5/view?usp=sharing
Expected behavior
For the mock generated in the repo level to be correct.
Additional context
Saved json, with trace :