diff --git a/equalsverifier-core/src/test/java/nl/jqno/equalsverifier/integration/operational/RecursionTest.java b/equalsverifier-core/src/test/java/nl/jqno/equalsverifier/integration/operational/RecursionTest.java index 952b32f0f..62ee05800 100644 --- a/equalsverifier-core/src/test/java/nl/jqno/equalsverifier/integration/operational/RecursionTest.java +++ b/equalsverifier-core/src/test/java/nl/jqno/equalsverifier/integration/operational/RecursionTest.java @@ -45,11 +45,21 @@ public void succeed_whenDatastructureIsRecursive_givenPrefabValues() { EqualsVerifier.forClass(Node.class).withPrefabValues(Node.class, red, blue).verify(); } + @Test + public void succeed_whenDatastructureIsRecursive_givenPrefabValuesForField() { + EqualsVerifier.forClass(Node.class).withPrefabValuesForField("node", red, blue).verify(); + } + @Test public void succeed_whenDatastructureIsRecursive_givenPrefabValuesOfSuperclass() { EqualsVerifier.forClass(SubNode.class).withPrefabValues(Node.class, red, blue).verify(); } + @Test + public void succeed_whenDatastructureIsRecursive_givenPrefabValuesForFieldOfSuperclass() { + EqualsVerifier.forClass(SubNode.class).withPrefabValuesForField("node", red, blue).verify(); + } + @Test public void fail_whenFieldIsARecursiveType() { ExpectedException @@ -66,6 +76,14 @@ public void succeed_whenFieldIsARecursiveType_givenPrefabValues() { .verify(); } + @Test + public void succeed_whenFieldIsARecursiveType_givenPrefabValuesForField() { + EqualsVerifier + .forClass(NodeContainer.class) + .withPrefabValuesForField("node", red, blue) + .verify(); + } + @Test public void succeed_whenFieldIsARecursiveType_givenPrefabValuesOfSuperclass() { EqualsVerifier @@ -74,6 +92,14 @@ public void succeed_whenFieldIsARecursiveType_givenPrefabValuesOfSuperclass() { .verify(); } + @Test + public void succeed_whenFieldIsARecursiveType_givenPrefabValuesForFieldOfSuperclass() { + EqualsVerifier + .forClass(SubNodeContainer.class) + .withPrefabValuesForField("node", red, blue) + .verify(); + } + @Test public void fail_whenDatastructureIsRecursiveInGenerics() { ExpectedException