Skip to content

Commit

Permalink
Add the same bean to List twice
Browse files Browse the repository at this point in the history
  • Loading branch information
gbadner authored and gsmet committed Mar 11, 2021
1 parent aea0642 commit cea9b8c
Showing 1 changed file with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
*/
package org.hibernate.validator.test.internal.engine.tracking;

import java.util.ArrayList;
import java.util.List;

import javax.validation.Valid;
Expand All @@ -26,7 +27,14 @@ public class ProcessedBeansTrackingNoCycles2Test {
public void testSerializeHibernateEmail() throws Exception {
Validator validator = ValidatorUtil.getValidator();

validator.validate( new Parent() );
final Parent parent = new Parent();
parent.property = "parent property";
final Child child = new Child();
child.property = "child property";
parent.children = new ArrayList<>();
parent.children.add( child );
parent.children.add( child );
validator.validate( parent );
}

private static class Parent {
Expand Down

0 comments on commit cea9b8c

Please sign in to comment.