Avoid UnsupportedEncodingException & use const from StandardCharsets (#11948)

Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
This commit is contained in:
Christoph Weitkamp
2022-01-03 16:05:08 +01:00
committed by GitHub
parent 3f54327d5a
commit 167f8ebc49
52 changed files with 180 additions and 414 deletions

View File

@@ -12,11 +12,11 @@
*/
package org.openhab.binding.ihc.internal.ws;
import static org.junit.jupiter.api.Assertions.*;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.mockito.Mockito.*;
import java.io.UnsupportedEncodingException;
import java.net.SocketTimeoutException;
import java.nio.charset.StandardCharsets;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
@@ -57,10 +57,10 @@ public class IhcClientTest {
}
@Test
public void loadProjectFileFromControllerTest() throws IhcExecption, UnsupportedEncodingException {
public void loadProjectFileFromControllerTest() throws IhcExecption {
final String expectedFileContent = ResourceFileUtils.getFileContent("ProjectFileContent.txt");
final byte[] result = ihcClient.getProjectFileFromController();
assertEquals(expectedFileContent, new String(result, "UTF-8"));
assertEquals(expectedFileContent, new String(result, StandardCharsets.UTF_8));
}
}