@Test
    void credentialsUnaryCall_fail() {
        final TestServiceBlockingStub stub =
                // Explicitly construct URL to better test authority.
                GrpcClients.builder("gproto+https://127.0.0.1:" + server.httpsPort())
                           .factory(ClientFactory.insecure())
                           .build(TestServiceBlockingStub.class)
                           .withCallCredentials(
                                   new CallCredentials() {
                                       @Override
                                       public void applyRequestMetadata(RequestInfo requestInfo,
                                                                        Executor appExecutor,
                                                                        MetadataApplier applier) {
                                           applier.fail(Status.FAILED_PRECONDITION);
                                       }

                                       @Override
                                       public void thisUsesUnstableApi() {
                                       }
                                   });

        assertThatThrownBy(() -> stub.emptyCall(EMPTY))
                .isInstanceOfSatisfying(StatusRuntimeException.class,
                                        t -> assertThat(t.getStatus().getCode())
                                                .isEqualTo(Code.FAILED_PRECONDITION));
    }
Must be at least {@link #unaryPayloadLength()}, plus some to account for encoding overhead.
grpc/src/test/java/com/linecorp/armeria/client/grpc/GrpcClientTest.java