Replace hardcoded charsets with StandardCharsets

This commit is contained in:
Mahmoud Ben Hassine
2023-07-04 21:57:28 +02:00
parent f0137bc54c
commit efdb59e570
3 changed files with 12 additions and 7 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2006-2022 the original author or authors.
* Copyright 2006-2023 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -16,6 +16,8 @@
package org.springframework.batch.sample;
import java.nio.charset.StandardCharsets;
import org.apache.commons.io.IOUtils;
import org.junit.jupiter.api.Test;
@@ -45,8 +47,9 @@ class MultilineJobFunctionalTests {
@Test
void testJobLaunch() throws Exception {
this.jobLauncherTestUtils.launchJob();
assertEquals(EXPECTED_RESULT, StringUtils.replace(IOUtils.toString(output.getInputStream(), "UTF-8"),
System.getProperty("line.separator"), ""));
assertEquals(EXPECTED_RESULT,
StringUtils.replace(IOUtils.toString(output.getInputStream(), StandardCharsets.UTF_8),
System.getProperty("line.separator"), ""));
}
}