Use a constant instead of a magic string

This commit is contained in:
Gary Gregory 2023-12-10 10:54:03 -05:00
parent f73fafb105
commit 0913090f2d
1 changed files with 2 additions and 2 deletions

View File

@ -289,8 +289,8 @@ public class EmptyPropertiesTest {
PropertiesFactory.INSTANCE.createProperties().store(expected, comments); PropertiesFactory.INSTANCE.createProperties().store(expected, comments);
// Properties.store stores the specified comment appended with current time stamp in the next line // Properties.store stores the specified comment appended with current time stamp in the next line
final String expectedComment = getFirstLine(expected.toString("UTF-8")); final String expectedComment = getFirstLine(expected.toString(StandardCharsets.UTF_8.name()));
final String actualComment = getFirstLine(actual.toString("UTF-8")); final String actualComment = getFirstLine(actual.toString(StandardCharsets.UTF_8.name()));
assertEquals(expectedComment, actualComment, assertEquals(expectedComment, actualComment,
() -> String.format("Expected String '%s' with length '%s'", expectedComment, expectedComment.length())); () -> String.format("Expected String '%s' with length '%s'", expectedComment, expectedComment.length()));
expected.reset(); expected.reset();