Skip to content

Commit 430519e

Browse files
committed
Remove trailing whitespace in JUnit assertion messages
1 parent 594c269 commit 430519e

3 files changed

Lines changed: 11 additions & 11 deletions

File tree

src/changes/changes.xml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,11 @@ The <action> type attribute can be add,update,fix,remove.
4848
<body>
4949
<release version="2.17.1" date="YYYY-MM-DD" description="Version 2.17.1: Java 8 is required.">
5050
<!-- FIX -->
51+
<action dev="ggregory" type="fix" due-to="Gary Gregory">Clean ups in unit tests.</action>
5152
<!-- ADD -->
5253
<!-- UPDATE -->
53-
<action dev="ggregory" type="update" due-to="Gary Gregory">Bump org.apache.commons:commons-parent from 74 to 76 #670, #676.</action>
54-
<action dev="ggregory" type="update" due-to="Gary Gregory">Bump commons.bytebuddy.version from 1.15.1 to 1.15.3 #672, #673.</action>
54+
<action dev="ggregory" type="update" due-to="Gary Gregory">Bump org.apache.commons:commons-parent from 74 to 76 #670, #676.</action>
55+
<action dev="ggregory" type="update" due-to="Gary Gregory">Bump commons.bytebuddy.version from 1.15.1 to 1.15.3 #672, #673.</action>
5556
</release>
5657
<release version="2.17.0" date="2024-09-15" description="Version 2.17.0: Java 8 is required.">
5758
<!-- ADD -->

src/test/java/org/apache/commons/io/input/SwappedDataInputStreamTest.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -114,8 +114,7 @@ public void testReadInt() throws IOException {
114114

115115
@Test
116116
public void testReadLine() {
117-
assertThrows(UnsupportedOperationException.class, () -> this.sdis.readLine(),
118-
"readLine should be unsupported. ");
117+
assertThrows(UnsupportedOperationException.class, () -> this.sdis.readLine(), "readLine should be unsupported.");
119118
}
120119

121120
@Test
@@ -140,7 +139,7 @@ public void testReadUnsignedShort() throws IOException {
140139

141140
@Test
142141
public void testReadUTF() {
143-
assertThrows(UnsupportedOperationException.class, () -> this.sdis.readUTF(), "readUTF should be unsupported. ");
142+
assertThrows(UnsupportedOperationException.class, () -> this.sdis.readUTF(), "readUTF should be unsupported.");
144143
}
145144

146145
@Test

src/test/java/org/apache/commons/io/output/LockableFileWriterTest.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -89,10 +89,10 @@ private void testAlternateLockDir(final LockableFileWriter lfw1) {
8989

9090
// try to open a second writer
9191
try (LockableFileWriter lfw2 = new LockableFileWriter(file, StandardCharsets.UTF_8, true, altLockDir.getAbsolutePath())) {
92-
fail("Somehow able to open a locked file. ");
92+
fail("Somehow able to open a locked file.");
9393
} catch (final IOException ioe) {
9494
final String msg = ioe.getMessage();
95-
assertTrue(msg.startsWith("Can't write file, lock "), "Exception message does not start correctly. ");
95+
assertTrue(msg.startsWith("Can't write file, lock "), "Exception message does not start correctly.");
9696
assertTrue(file.exists());
9797
assertTrue(altLockFile.exists());
9898
}
@@ -163,20 +163,20 @@ public void testFileLocked() throws IOException {
163163

164164
// try to open a second writer
165165
try (LockableFileWriter lfw2 = new LockableFileWriter(file)) {
166-
fail("Somehow able to open a locked file. ");
166+
fail("Somehow able to open a locked file.");
167167
} catch (final IOException ioe) {
168168
final String msg = ioe.getMessage();
169-
assertTrue(msg.startsWith("Can't write file, lock "), "Exception message does not start correctly. ");
169+
assertTrue(msg.startsWith("Can't write file, lock "), "Exception message does not start correctly.");
170170
assertTrue(file.exists());
171171
assertTrue(lockFile.exists());
172172
}
173173

174174
// try to open a third writer
175175
try (LockableFileWriter lfw3 = new LockableFileWriter(file)) {
176-
fail("Somehow able to open a locked file. ");
176+
fail("Somehow able to open a locked file.");
177177
} catch (final IOException ioe) {
178178
final String msg = ioe.getMessage();
179-
assertTrue(msg.startsWith("Can't write file, lock "), "Exception message does not start correctly. ");
179+
assertTrue(msg.startsWith("Can't write file, lock "), "Exception message does not start correctly.");
180180
assertTrue(file.exists());
181181
assertTrue(lockFile.exists());
182182
}

0 commit comments

Comments
 (0)