From 2ca6c48cf91f8ffb4a2d60e5e265fb1d35926f37 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nadja=20M=C3=BCller?= Date: Tue, 3 Oct 2023 20:16:46 +0200 Subject: [PATCH] [pLz5YbCW] improve checks for debugging --- core/src/test/java/apoc/merge/MergeTest.java | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/core/src/test/java/apoc/merge/MergeTest.java b/core/src/test/java/apoc/merge/MergeTest.java index 18802a6b5..d78765fdd 100644 --- a/core/src/test/java/apoc/merge/MergeTest.java +++ b/core/src/test/java/apoc/merge/MergeTest.java @@ -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."); } } @@ -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."); } } @@ -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."); } } @@ -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.")); } } @@ -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.")); } }