Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
rubenporras authored Oct 17, 2023
1 parent e4faece commit 8cfafec
Showing 1 changed file with 4 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand All @@ -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);
}

Expand All @@ -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));
}

Expand All @@ -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);
}

Expand Down

0 comments on commit 8cfafec

Please sign in to comment.