From 8cfafec0306e59b4d2a6b7e65e13a4c172060cf6 Mon Sep 17 00:00:00 2001 From: rubenporras <43636626+rubenporras@users.noreply.github.com> Date: Tue, 17 Oct 2023 12:46:03 +0200 Subject: [PATCH] fix --- .../test/validation/AbstractValidationTest.java | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/com.avaloq.tools.ddk.xtext.test.core/src/com/avaloq/tools/ddk/xtext/test/validation/AbstractValidationTest.java b/com.avaloq.tools.ddk.xtext.test.core/src/com/avaloq/tools/ddk/xtext/test/validation/AbstractValidationTest.java index 42f6c5f27..41310d3d7 100644 --- a/com.avaloq.tools.ddk.xtext.test.core/src/com/avaloq/tools/ddk/xtext/test/validation/AbstractValidationTest.java +++ b/com.avaloq.tools.ddk.xtext.test.core/src/com/avaloq/tools/ddk/xtext/test/validation/AbstractValidationTest.java @@ -786,9 +786,7 @@ protected void assertDiagnostic(final String issueCode) { * the code of the issue to look for */ protected void assertDiagnostic(final EObject model, final String issueCode) { - if (model == null) { - fail("Issue with code '" + issueCode + "' cannot be found because the model is null"); - } + assertNotNull("Issue with code '" + issueCode + "' cannot be found because the model is null", model); assertDiagnostic(getXtextTestUtil().getDiagnostician().validate(model), issueCode); } @@ -811,10 +809,7 @@ protected void assertNoDiagnostic(final String issueCode) { * the code of the issue to look for */ protected void assertNoDiagnostic(final EObject model, final String issueCode) { - if (model == null) { - fail("Issue with code '" + issueCode + "' cannot be found because the model is null"); - } - + assertNotNull("Issue with code '" + issueCode + "' cannot be found because the model is null", model); assertNoDiagnostic(getXtextTestUtil().getDiagnostician().validate(model), issueCode); } @@ -832,7 +827,7 @@ protected void assertNoDiagnostics() { * the model in which to look for issues, may be {@code null} */ protected void assertNoDiagnostics(final EObject model) { - assertNotNull("Assertion cannot be checked because the model is null", model == null); + assertNotNull("Assertion cannot be checked because the model is null", model); assertNoDiagnostics(getXtextTestUtil().getDiagnostician().validate(model)); } @@ -855,10 +850,7 @@ protected void assertDiagnosticMessage(final String message) { * the message of the issue to look for */ protected void assertDiagnosticMessage(final EObject model, final String message) { - if (model == null) { - fail("Message '" + message + "' cannot be found because the model is null"); - } - + assertNotNull("Message '" + message + "' cannot be found because the model is null", model); assertDiagnosticMessage(getXtextTestUtil().getDiagnostician().validate(model), message); }