Skip to content

Commit 26debe8

Browse files
committed
final version of experiment
1 parent 0f8286b commit 26debe8

File tree

1 file changed

+14
-7
lines changed

1 file changed

+14
-7
lines changed

java-showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITHttpAnnotation.java

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919

2020
import com.google.api.client.http.javanet.NetHttpTransport;
2121
import com.google.api.gax.core.NoCredentialsProvider;
22+
import com.google.common.base.Charsets;
2223
import com.google.common.collect.ImmutableMap;
2324
import com.google.protobuf.util.JsonFormat;
2425
import com.google.showcase.v1beta1.ComplianceClient;
@@ -31,6 +32,8 @@
3132
import com.google.showcase.v1beta1.it.util.TestClientInitializer;
3233
import java.io.IOException;
3334
import java.io.InputStreamReader;
35+
import java.nio.charset.Charset;
36+
import java.nio.charset.StandardCharsets;
3437
import java.security.GeneralSecurityException;
3538
import java.util.List;
3639
import java.util.Map;
@@ -74,7 +77,8 @@ static void createClients() throws IOException, GeneralSecurityException {
7477
Objects.requireNonNull(
7578
ITHttpAnnotation.class
7679
.getClassLoader()
77-
.getResourceAsStream("compliance_suite.json"))),
80+
.getResourceAsStream("compliance_suite.json")),
81+
StandardCharsets.UTF_8),
7882
builder);
7983
complianceSuite = builder.build();
8084

@@ -118,16 +122,19 @@ static void destroyClients() throws InterruptedException {
118122

119123
@Test
120124
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);
126133
int count = 0;
127134
while(streamReader.ready()) {
128135
count += streamReader.read();
129136
}
130-
assertThat(count).isEqualTo(434436);
137+
assertThat(count).isEqualTo(434636);
131138
}
132139

133140
// Verify that the input's info is the same as the response's info

0 commit comments

Comments
 (0)