Skip to content

Commit

Permalink
Use a constant instead of a magic string
Browse files Browse the repository at this point in the history
  • Loading branch information
garydgregory committed Dec 10, 2023
1 parent f73fafb commit 0913090
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -289,8 +289,8 @@ public void testSave() throws IOException {
PropertiesFactory.INSTANCE.createProperties().store(expected, comments);

// 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 actualComment = getFirstLine(actual.toString("UTF-8"));
final String expectedComment = getFirstLine(expected.toString(StandardCharsets.UTF_8.name()));
final String actualComment = getFirstLine(actual.toString(StandardCharsets.UTF_8.name()));
assertEquals(expectedComment, actualComment,
() -> String.format("Expected String '%s' with length '%s'", expectedComment, expectedComment.length()));
expected.reset();
Expand Down

0 comments on commit 0913090

Please sign in to comment.