|
19 | 19 |
|
20 | 20 | import com.google.api.client.http.javanet.NetHttpTransport; |
21 | 21 | import com.google.api.gax.core.NoCredentialsProvider; |
| 22 | +import com.google.common.base.Charsets; |
22 | 23 | import com.google.common.collect.ImmutableMap; |
23 | 24 | import com.google.protobuf.util.JsonFormat; |
24 | 25 | import com.google.showcase.v1beta1.ComplianceClient; |
|
31 | 32 | import com.google.showcase.v1beta1.it.util.TestClientInitializer; |
32 | 33 | import java.io.IOException; |
33 | 34 | import java.io.InputStreamReader; |
| 35 | +import java.nio.charset.Charset; |
| 36 | +import java.nio.charset.StandardCharsets; |
34 | 37 | import java.security.GeneralSecurityException; |
35 | 38 | import java.util.List; |
36 | 39 | import java.util.Map; |
@@ -74,7 +77,8 @@ static void createClients() throws IOException, GeneralSecurityException { |
74 | 77 | Objects.requireNonNull( |
75 | 78 | ITHttpAnnotation.class |
76 | 79 | .getClassLoader() |
77 | | - .getResourceAsStream("compliance_suite.json"))), |
| 80 | + .getResourceAsStream("compliance_suite.json")), |
| 81 | + StandardCharsets.UTF_8), |
78 | 82 | builder); |
79 | 83 | complianceSuite = builder.build(); |
80 | 84 |
|
@@ -118,16 +122,19 @@ static void destroyClients() throws InterruptedException { |
118 | 122 |
|
119 | 123 | @Test |
120 | 124 | void verifyByteSizeOfExtremePayload() throws IOException { |
121 | | - InputStreamReader streamReader = new InputStreamReader( |
122 | | - Objects.requireNonNull( |
123 | | - ITHttpAnnotation.class |
124 | | - .getClassLoader() |
125 | | - .getResourceAsStream("compliance_suite.json"))); |
| 125 | + System.out.println(System.getProperty("file.encoding")); |
| 126 | + InputStreamReader streamReader = |
| 127 | + new InputStreamReader( |
| 128 | + Objects.requireNonNull( |
| 129 | + ITHttpAnnotation.class |
| 130 | + .getClassLoader() |
| 131 | + .getResourceAsStream("compliance_suite.json")), |
| 132 | + StandardCharsets.UTF_8); |
126 | 133 | int count = 0; |
127 | 134 | while(streamReader.ready()) { |
128 | 135 | count += streamReader.read(); |
129 | 136 | } |
130 | | - assertThat(count).isEqualTo(434436); |
| 137 | + assertThat(count).isEqualTo(434636); |
131 | 138 | } |
132 | 139 |
|
133 | 140 | // Verify that the input's info is the same as the response's info |
|
0 commit comments