File tree 3 files changed +9
-3
lines changed
src/test/java/org/springframework/data/neo4j/integration
3 files changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -1450,7 +1450,10 @@ void saveEntityWithRelationshipWithProperties(
1450
1450
PersonWithRelationshipWithProperties shouldBeDifferentPerson = repository .save (person );
1451
1451
1452
1452
// then
1453
- assertThat (shouldBeDifferentPerson ).isNotNull ().isEqualToComparingOnlyGivenFields (person , "hobbies" );
1453
+ assertThat (shouldBeDifferentPerson ).isNotNull ()
1454
+ .usingRecursiveComparison ()
1455
+ .ignoringFieldsMatchingRegexes ("^(?:(?!hobbies).)*$" )
1456
+ .isEqualTo (person );
1454
1457
1455
1458
assertThat (shouldBeDifferentPerson .getName ()).isEqualToIgnoringCase ("Freddie clone" );
1456
1459
Original file line number Diff line number Diff line change 35
35
import org .springframework .context .annotation .Configuration ;
36
36
import org .springframework .dao .DataIntegrityViolationException ;
37
37
import org .springframework .data .neo4j .config .AbstractReactiveNeo4jConfig ;
38
+ import org .springframework .data .neo4j .core .Neo4jPersistenceExceptionTranslator ;
38
39
import org .springframework .data .neo4j .core .ReactiveNeo4jClient ;
39
40
import org .springframework .data .neo4j .integration .shared .common .SimplePerson ;
40
41
import org .springframework .data .neo4j .repository .ReactiveNeo4jRepository ;
41
42
import org .springframework .data .neo4j .repository .config .EnableReactiveNeo4jRepositories ;
42
- import org .springframework .data .neo4j .repository .support .Neo4jPersistenceExceptionTranslator ;
43
43
import org .springframework .data .neo4j .repository .support .ReactivePersistenceExceptionTranslationPostProcessor ;
44
44
import org .springframework .data .neo4j .test .Neo4jExtension ;
45
45
import org .springframework .data .neo4j .test .Neo4jIntegrationTest ;
Original file line number Diff line number Diff line change @@ -1184,7 +1184,10 @@ void saveEntityWithRelationshipWithProperties(
1184
1184
assertThat (shouldBeDifferentPersons ).size ().isEqualTo (1 );
1185
1185
1186
1186
PersonWithRelationshipWithProperties shouldBeDifferentPerson = shouldBeDifferentPersons .get (0 );
1187
- assertThat (shouldBeDifferentPerson ).isNotNull ().isEqualToComparingOnlyGivenFields (person , "hobbies" );
1187
+ assertThat (shouldBeDifferentPerson ).isNotNull ()
1188
+ .usingRecursiveComparison ()
1189
+ .ignoringFieldsMatchingRegexes ("^(?:(?!hobbies).)*$" )
1190
+ .isEqualTo (person );
1188
1191
assertThat (shouldBeDifferentPerson .getName ()).isEqualToIgnoringCase ("Freddie clone" );
1189
1192
1190
1193
// check content of db
You can’t perform that action at this time.
0 commit comments