Skip to content

Commit fca6572

Browse files
committed
chore: add temporary confirmation test for compliance_suite payload serialization
1 parent aef1bed commit fca6572

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

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

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@
4242
import java.util.stream.Stream;
4343
import org.junit.jupiter.api.AfterAll;
4444
import org.junit.jupiter.api.BeforeAll;
45+
import org.junit.jupiter.api.Test;
4546
import org.junit.jupiter.params.ParameterizedTest;
4647
import org.junit.jupiter.params.provider.Arguments;
4748
import org.junit.jupiter.params.provider.MethodSource;
@@ -115,6 +116,19 @@ static void destroyClients() throws InterruptedException {
115116
TestClientInitializer.AWAIT_TERMINATION_SECONDS, TimeUnit.SECONDS);
116117
}
117118

119+
@Test
120+
void verifyByteSizeOfExtremePayload() {
121+
RepeatRequest request = complianceSuite.getGroup(0).getRequests(3);
122+
assertThat(request.getName()).isEqualTo("Extreme values");
123+
int fStringCount = request.getInfo().getFString().length();
124+
assertThat(fStringCount).isEqualTo(69);
125+
System.out.println(request.getInfo().getFString());
126+
int fStringBytes = request.getInfo().getFStringBytes().size();
127+
assertThat(fStringBytes).isEqualTo(77);
128+
int requestBytes = request.getSerializedSize();
129+
assertThat(requestBytes).isEqualTo(222);
130+
}
131+
118132
// Verify that the input's info is the same as the response's info
119133
// This ensures that the entire group's behavior over HttpJson
120134
// works as intended

0 commit comments

Comments
 (0)