GH-2544 - Polishing.

This commit is contained in:
Michael Simons
2022-05-30 10:27:04 +02:00
parent 4aa58754e3
commit 9a73f5b3d7
2 changed files with 16 additions and 4 deletions

View File

@@ -805,12 +805,18 @@ class Neo4jTemplateIT {
assertThat(projections).isEmpty();
}
static class X {
}
static class Y {
}
@Test // GH-2544
void saveWeirdHierarchy() {
List<Object> things = new ArrayList<>();
things.add(1);
things.add("eins");
things.add(new X());
things.add(new Y());
assertThatIllegalArgumentException().isThrownBy(() -> neo4jTemplate.saveAllAs(things, ClosedProjection.class))
.withMessage("Could not determine a common element of an heterogeneous collection.");

View File

@@ -697,12 +697,18 @@ class ReactiveNeo4jTemplateIT {
.verifyComplete();
}
static class X {
}
static class Y {
}
@Test // GH-2544
void saveWeirdHierarchy(@Autowired ReactiveNeo4jTemplate template) {
List<Object> things = new ArrayList<>();
things.add(1);
things.add("eins");
things.add(new X());
things.add(new Y());
template.saveAllAs(things, ClosedProjection.class)
.as(StepVerifier::create)