Skip to content

Commit 58342bd

Browse files
committed
Fix forbiddenapis violation: use explicit UTF-8 charset
Replace new String(byte[]) with new String(byte[], StandardCharsets.UTF_8) to satisfy the forbiddenapis Maven plugin check.
1 parent 911fe67 commit 58342bd

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

modules/openapi-generator/src/test/java/org/openapitools/codegen/typescript/fetch/TypeScriptFetchClientCodegenTest.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121

2222
import java.io.File;
2323
import java.io.IOException;
24+
import java.nio.charset.StandardCharsets;
2425
import java.nio.file.Files;
2526
import java.nio.file.Path;
2627
import java.nio.file.Paths;
@@ -469,7 +470,7 @@ public void testRequestOptsInInterfaceByDefault() throws IOException {
469470
TestUtils.assertFileExists(apiFile);
470471

471472
// Read file content and split into interface and class sections
472-
String content = new String(Files.readAllBytes(apiFile));
473+
String content = new String(Files.readAllBytes(apiFile), StandardCharsets.UTF_8);
473474
int interfaceStart = content.indexOf("export interface PetControllerApiInterface");
474475
int classStart = content.indexOf("export class PetControllerApi");
475476
String interfaceSection = content.substring(interfaceStart, classStart);
@@ -494,7 +495,7 @@ public void testRequestOptsNotInInterfaceWhenDisabled() throws IOException {
494495
TestUtils.assertFileExists(apiFile);
495496

496497
// Read file content and split into interface and class sections
497-
String content = new String(Files.readAllBytes(apiFile));
498+
String content = new String(Files.readAllBytes(apiFile), StandardCharsets.UTF_8);
498499
int interfaceStart = content.indexOf("export interface PetControllerApiInterface");
499500
int classStart = content.indexOf("export class PetControllerApi");
500501
String interfaceSection = content.substring(interfaceStart, classStart);

0 commit comments

Comments
 (0)