Remove trailing whitespace in JUnit assertion messages

This commit is contained in:
Gary Gregory 2024-10-06 09:49:14 -04:00
parent 4dcba05531
commit e3883c0d69
2 changed files with 15 additions and 27 deletions

View File

@ -622,13 +622,13 @@ public class DurationFormatUtilsTest extends AbstractLangTest {
final DurationFormatUtils.Token token = createTokenWithCount(DurationFormatUtils.y, 4); final DurationFormatUtils.Token token = createTokenWithCount(DurationFormatUtils.y, 4);
assertEquals(token, token); assertEquals(token, token);
assertEquals(token.hashCode(), token.hashCode()); assertEquals(token.hashCode(), token.hashCode());
assertNotEquals(token, new Object(), "Token equal to non-Token class. "); assertNotEquals(token, new Object(), "Token equal to non-Token class.");
final Token token2 = createTokenWithCount("", 1); final Token token2 = createTokenWithCount("", 1);
assertNotEquals(token, token2, "Token equal to Token with wrong value class. "); assertNotEquals(token, token2, "Token equal to Token with wrong value class.");
assertNotEquals(token.hashCode(), token2.hashCode()); assertNotEquals(token.hashCode(), token2.hashCode());
assertNotEquals(token, createTokenWithCount(DurationFormatUtils.y, 1), "Token equal to Token with different count. "); assertNotEquals(token, createTokenWithCount(DurationFormatUtils.y, 1), "Token equal to Token with different count.");
final DurationFormatUtils.Token numToken = createTokenWithCount("1", 4); final DurationFormatUtils.Token numToken = createTokenWithCount("1", 4);
assertEquals(numToken, numToken, "Token with Number value not equal to itself. "); assertEquals(numToken, numToken, "Token with Number value not equal to itself.");
} }
@Test @Test

View File

@ -98,31 +98,19 @@ public class StopWatchTest extends AbstractLangTest {
@Test @Test
public void testBadStates() { public void testBadStates() {
final StopWatch watch = new StopWatch(); final StopWatch watch = new StopWatch();
assertThrows(IllegalStateException.class, watch::stop, "Calling stop on an unstarted StopWatch should throw an exception. "); assertThrows(IllegalStateException.class, watch::stop, "Calling stop on an unstarted StopWatch should throw an exception.");
assertThrows(IllegalStateException.class, watch::suspend, "Calling suspend on an unstarted StopWatch should throw an exception.");
assertThrows(IllegalStateException.class, watch::suspend, "Calling suspend on an unstarted StopWatch should throw an exception. "); assertThrows(IllegalStateException.class, watch::split, "Calling split on a non-running StopWatch should throw an exception.");
assertThrows(IllegalStateException.class, watch::unsplit, "Calling unsplit on an unsplit StopWatch should throw an exception.");
assertThrows(IllegalStateException.class, watch::split, "Calling split on a non-running StopWatch should throw an exception. "); assertThrows(IllegalStateException.class, watch::resume, "Calling resume on an unsuspended StopWatch should throw an exception.");
assertThrows(IllegalStateException.class, watch::unsplit, "Calling unsplit on an unsplit StopWatch should throw an exception. ");
assertThrows(IllegalStateException.class, watch::resume, "Calling resume on an unsuspended StopWatch should throw an exception. ");
watch.start(); watch.start();
assertThrows(IllegalStateException.class, watch::start, "Calling start on a started StopWatch should throw an exception.");
assertThrows(IllegalStateException.class, watch::start, "Calling start on a started StopWatch should throw an exception. "); assertThrows(IllegalStateException.class, watch::unsplit, "Calling unsplit on an unsplit StopWatch should throw an exception.");
assertThrows(IllegalStateException.class, watch::getSplitTime, "Calling getSplitTime on an unsplit StopWatch should throw an exception.");
assertThrows(IllegalStateException.class, watch::unsplit, "Calling unsplit on an unsplit StopWatch should throw an exception. "); assertThrows(IllegalStateException.class, watch::getSplitDuration, "Calling getSplitTime on an unsplit StopWatch should throw an exception.");
assertThrows(IllegalStateException.class, watch::resume, "Calling resume on an unsuspended StopWatch should throw an exception.");
assertThrows(IllegalStateException.class, watch::getSplitTime, "Calling getSplitTime on an unsplit StopWatch should throw an exception. ");
assertThrows(IllegalStateException.class, watch::getSplitDuration, "Calling getSplitTime on an unsplit StopWatch should throw an exception. ");
assertThrows(IllegalStateException.class, watch::resume, "Calling resume on an unsuspended StopWatch should throw an exception. ");
watch.stop(); watch.stop();
assertThrows(IllegalStateException.class, watch::start, "Calling start on a stopped StopWatch should throw an exception as it needs to be reset.");
assertThrows(IllegalStateException.class, watch::start, "Calling start on a stopped StopWatch should throw an exception as it needs to be reset. ");
} }
@Test @Test