Skip to content

Commit

Permalink
[pLz5YbCW] improve checks for debugging
Browse files Browse the repository at this point in the history
  • Loading branch information
nadja-muller committed Oct 3, 2023
1 parent ae0390e commit 2ca6c48
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions core/src/test/java/apoc/merge/MergeTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,8 @@ public void testMergeNodeWithNullLabelsShouldFail() {
row -> assertTrue(row.get("node") instanceof Node));
fail();
} catch (QueryExecutionException e) {
assertTrue(e.getMessage().contains("The list of label names may not contain any null or empty String values. If you wish to merge a node without a label, pass an empty list instead."));
assertEquals(e.getMessage(), "Failed to invoke procedure `apoc.merge.node`: Caused by: java.lang.IllegalArgumentException: " +
"The list of label names may not contain any null or empty String values. If you wish to merge a node without a label, pass an empty list instead.");
}
}

Expand All @@ -143,7 +144,8 @@ public void testMergeNodeWithEmptyLabelListShouldFail() {
row -> assertTrue(row.get("node") instanceof Node));
fail();
} catch (QueryExecutionException e) {
assertTrue(e.getMessage().contains("The list of label names may not contain any null or empty String values. If you wish to merge a node without a label, pass an empty list instead."));
assertEquals(e.getMessage(), "Failed to invoke procedure `apoc.merge.node`: Caused by: java.lang.IllegalArgumentException: " +
"The list of label names may not contain any null or empty String values. If you wish to merge a node without a label, pass an empty list instead.");
}
}

Expand All @@ -154,7 +156,8 @@ public void testMergeNodeContainingEmptyLabelShouldFail() {
row -> assertTrue(row.get("node") instanceof Node));
fail();
} catch (QueryExecutionException e) {
assertTrue(e.getMessage().contains("The list of label names may not contain any null or empty String values. If you wish to merge a node without a label, pass an empty list instead."));
assertEquals(e.getMessage(), "Failed to invoke procedure `apoc.merge.node`: Caused by: java.lang.IllegalArgumentException: " +
"The list of label names may not contain any null or empty String values. If you wish to merge a node without a label, pass an empty list instead.");
}
}

Expand Down Expand Up @@ -227,7 +230,8 @@ public void testMergeRelWithNullRelTypeShouldFail() {
row -> assertTrue(row.get("rel") instanceof Relationship));
fail();
} catch (QueryExecutionException e) {
assertTrue(e.getMessage().contains("It is not possible to merge a relationship without a relationship type."));
assertEquals(e.getMessage(), ("Failed to invoke procedure `apoc.merge.relationship`: Caused by: java.lang.IllegalArgumentException: " +
"It is not possible to merge a relationship without a relationship type."));
}
}

Expand All @@ -238,7 +242,8 @@ public void testMergeWithEmptyRelTypeShouldFail() {
row -> assertTrue(row.get("rel") instanceof Relationship));
fail();
} catch (QueryExecutionException e) {
assertTrue(e.getMessage().contains("It is not possible to merge a relationship without a relationship type."));
assertEquals(e.getMessage(), ("Failed to invoke procedure `apoc.merge.relationship`: Caused by: java.lang.IllegalArgumentException: " +
"It is not possible to merge a relationship without a relationship type."));
}
}

Expand Down

0 comments on commit 2ca6c48

Please sign in to comment.