@Test
    void maxInboundSize_tooBig() throws Exception {
        final StreamingOutputCallRequest request =
                StreamingOutputCallRequest.newBuilder()
                                          .addResponseParameters(ResponseParameters.newBuilder().setSize(1))
                                          .build();
        final Iterator<StreamingOutputCallResponse> response = blockingStub.streamingOutputCall(request);
        final int size = response.next().getSerializedSize();
        // Need to drain the inbound stream to ensure request-log is available.
        assertThat(response.hasNext()).isFalse();

        requestLogQueue.take();

        final TestServiceBlockingStub stub =
                Clients.newDerivedClient(
                        blockingStub,
                        GrpcClientOptions.MAX_INBOUND_MESSAGE_SIZE_BYTES.newValue(size - 1));
        final Throwable t = catchThrowable(() -> stub.streamingOutputCall(request).next());
        assertThat(t).isInstanceOf(StatusRuntimeException.class);
        assertThat(((StatusRuntimeException) t).getStatus().getCode()).isEqualTo(Code.RESOURCE_EXHAUSTED);
        assertThat(Exceptions.traceText(t)).contains("exceeds maximum");

        checkRequestLog((rpcReq, rpcRes, grpcStatus) -> {
            assertThat(rpcReq.params()).containsExactly(request);
            assertThat(grpcStatus).isNotNull();
            assertThat(grpcStatus.getCode()).isEqualTo(Code.RESOURCE_EXHAUSTED);
        });
    }
Must be at least {@link #unaryPayloadLength()}, plus some to account for encoding overhead.
grpc/src/test/java/com/linecorp/armeria/client/grpc/GrpcClientTest.java