@Test
    void errorWithMessage() throws Exception {
        final BiConsumer<Status, Metadata> checkException = (status, meta) -> {
            assertThat(status).isNotNull();
            assertThat(status.getCode()).isEqualTo(Code.DATA_LOSS);
            assertThat(status.getDescription()).isEqualTo("data loss!");
            assertThat(status.getCause()).isNull();
            assertThat(meta).isNotNull();
            assertThat(meta.getAll(INT_32_VALUE_KEY))
                    .containsExactly(Int32Value.newBuilder().setValue(1).build());
            assertThat(meta.get(CUSTOM_VALUE_KEY)).isEqualTo("string");
        };
        final Throwable t = catchThrowable(() -> unitTestBlockingStub.errorWithMessage(REQUEST_MESSAGE));
        assertThat(t).isInstanceOfSatisfying(StatusRuntimeException.class,
                                             ex -> checkException.accept(ex.getStatus(), ex.getTrailers()));
        checkRequestLogError((headers, rpcReq, cause) -> {
            assertThat(rpcReq).isNotNull();
            assertThat(rpcReq.serviceName()).isEqualTo("armeria.grpc.testing.UnitTestService");
            assertThat(rpcReq.method()).isEqualTo("ErrorWithMessage");
            assertThat(rpcReq.params()).containsExactly(REQUEST_MESSAGE);
            assertThat(cause).isInstanceOfSatisfying(
                    StatusRuntimeException.class, ex -> checkException.accept(ex.getStatus(),
                                                                              ex.getTrailers()));
        });
    }
Must be at least {@link #unaryPayloadLength()}, plus some to account for encoding overhead.
grpc/src/test/java/com/linecorp/armeria/client/grpc/GrpcClientTest.java