From 14872511e5d85deec1ccb67af6291c264af1c7fd Mon Sep 17 00:00:00 2001 From: Elliotte Rusty Harold Date: Thu, 9 Jan 2025 20:53:13 +0000 Subject: [PATCH] Make asserts meaningful (#232) --- .../java/org/apache/maven/scm/plugin/ChangeLogMojoTest.java | 4 ++-- .../java/org/apache/maven/scm/plugin/CheckoutMojoTest.java | 2 +- .../test/java/org/apache/maven/scm/plugin/UntagMojoTest.java | 2 +- .../java/org/apache/maven/scm/plugin/ValidateMojoTest.java | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/maven-scm-plugin/src/test/java/org/apache/maven/scm/plugin/ChangeLogMojoTest.java b/maven-scm-plugin/src/test/java/org/apache/maven/scm/plugin/ChangeLogMojoTest.java index fa66f0284..e1e2e38f2 100644 --- a/maven-scm-plugin/src/test/java/org/apache/maven/scm/plugin/ChangeLogMojoTest.java +++ b/maven-scm-plugin/src/test/java/org/apache/maven/scm/plugin/ChangeLogMojoTest.java @@ -103,7 +103,7 @@ public void testChangeLogWithBadUserDateFormat() throws Exception { fail("mojo execution must fail."); } catch (MojoExecutionException e) { - assertTrue(true); + assertNotNull(e.getMessage()); } } @@ -126,7 +126,7 @@ public void testChangeLogWithBadConnectionUrl() throws Exception { fail("mojo execution must fail."); } catch (MojoExecutionException e) { - assertTrue(true); + assertNotNull(e.getMessage()); } } } diff --git a/maven-scm-plugin/src/test/java/org/apache/maven/scm/plugin/CheckoutMojoTest.java b/maven-scm-plugin/src/test/java/org/apache/maven/scm/plugin/CheckoutMojoTest.java index f3d00cbe2..2760211ca 100644 --- a/maven-scm-plugin/src/test/java/org/apache/maven/scm/plugin/CheckoutMojoTest.java +++ b/maven-scm-plugin/src/test/java/org/apache/maven/scm/plugin/CheckoutMojoTest.java @@ -107,7 +107,7 @@ public void testSkipCheckoutWithoutConnectionUrl() throws Exception { fail("mojo execution must fail."); } catch (MojoExecutionException e) { - assertTrue(true); + assertNotNull(e.getMessage()); } } diff --git a/maven-scm-plugin/src/test/java/org/apache/maven/scm/plugin/UntagMojoTest.java b/maven-scm-plugin/src/test/java/org/apache/maven/scm/plugin/UntagMojoTest.java index ddae0c366..c47ab595d 100644 --- a/maven-scm-plugin/src/test/java/org/apache/maven/scm/plugin/UntagMojoTest.java +++ b/maven-scm-plugin/src/test/java/org/apache/maven/scm/plugin/UntagMojoTest.java @@ -102,7 +102,7 @@ public void testUntag() throws Exception { fail("mojo execution must fail."); } catch (MojoExecutionException e) { - assertTrue(true); + assertNotNull(e.getMessage()); } } diff --git a/maven-scm-plugin/src/test/java/org/apache/maven/scm/plugin/ValidateMojoTest.java b/maven-scm-plugin/src/test/java/org/apache/maven/scm/plugin/ValidateMojoTest.java index 53cc347ad..5289b7cb8 100644 --- a/maven-scm-plugin/src/test/java/org/apache/maven/scm/plugin/ValidateMojoTest.java +++ b/maven-scm-plugin/src/test/java/org/apache/maven/scm/plugin/ValidateMojoTest.java @@ -52,7 +52,7 @@ public void testValidateWithInvalidScmUrls() throws Exception { fail("mojo execution must fail."); } catch (MojoExecutionException e) { - assertTrue(true); + assertNotNull(e.getMessage()); } } }