@Test
    public void notAllowed() throws Exception {
        final HelloService.Iface client =
                ThriftClients.newClient(server.httpUri(TEXT) + "/hellobinaryonly", HelloService.Iface.class);
        assertThatThrownBy(() -> client.hello("Trustin")).isInstanceOf(TTransportException.class)
                                                         .cause()
                                                         .isInstanceOf(InvalidResponseHeadersException.class)
                                                         .hasMessageContaining(":status=415");
    }
Test of serialization format validation / detection based on HTTP headers.
thrift/thrift0.13/src/test/java/com/linecorp/armeria/server/thrift/ThriftSerializationFormatsTest.java