@Test void testGetPayloadReturnsAnIdenticalObjectAsInsertedThroughTheQueryResponseMessage() { TestQueryResponse expectedQuery = TEST_QUERY_RESPONSE; QueryResponseMessage<TestQueryResponse> testQueryResponseMessage = GenericQueryResponseMessage.asResponseMessage(expectedQuery); QueryResponse testQueryResponse = querySerializer.serializeResponse(testQueryResponseMessage, REQUEST_MESSAGE_ID); GrpcBackedResponseMessage<TestQueryResponse> testSubject = new GrpcBackedResponseMessage<>(testQueryResponse, serializer); assertEquals(expectedQuery, testSubject.getPayload()); }
@Override public R getPayload() { if (isExceptional()) { throw new IllegalPayloadAccessException( "This result completed exceptionally, payload is not available. " + "Try calling 'exceptionResult' to see the cause of failure.", exception ); } return serializedPayload == null ? null : serializedPayload.getObject(); }
GrpcBackedResponseMessage implements QueryResponseMessage<R> { @Override public R getPayload() { if (isExceptional()) { throw new IllegalPayloadAccessException( "This result completed exceptionally, payload is not available. " + "Try calling 'exceptionResult' to see the cause of failure.", exception ); } return serializedPayload == null ? null : serializedPayload.getObject(); } }
GrpcBackedResponseMessage implements QueryResponseMessage<R> { @Override public R getPayload() { if (isExceptional()) { throw new IllegalPayloadAccessException( "This result completed exceptionally, payload is not available. " + "Try calling 'exceptionResult' to see the cause of failure.", exception ); } return serializedPayload == null ? null : serializedPayload.getObject(); } GrpcBackedResponseMessage(QueryResponse queryResponse, Serializer serializer); private  GrpcBackedResponseMessage(QueryResponse queryResponse,
                                      LazyDeserializingObject<R> serializedPayload,
                                      Throwable exception,
                                      Supplier<MetaData> metaDataSupplier); }
GrpcBackedResponseMessage implements QueryResponseMessage<R> { @Override public R getPayload() { if (isExceptional()) { throw new IllegalPayloadAccessException( "This result completed exceptionally, payload is not available. " + "Try calling 'exceptionResult' to see the cause of failure.", exception ); } return serializedPayload == null ? null : serializedPayload.getObject(); } GrpcBackedResponseMessage(QueryResponse queryResponse, Serializer serializer); private  GrpcBackedResponseMessage(QueryResponse queryResponse,
                                      LazyDeserializingObject<R> serializedPayload,
                                      Throwable exception,
                                      Supplier<MetaData> metaDataSupplier); @Override String getIdentifier(); @Override MetaData getMetaData(); @Override R getPayload(); @Override Class<R> getPayloadType(); @Override boolean isExceptional(); @Override Optional<Throwable> optionalExceptionResult(); @Override GrpcBackedResponseMessage<R> withMetaData(Map<String, ?> metaData); @Override GrpcBackedResponseMessage<R> andMetaData(Map<String, ?> metaData); }
GrpcBackedResponseMessage implements QueryResponseMessage<R> { @Override public R getPayload() { if (isExceptional()) { throw new IllegalPayloadAccessException( "This result completed exceptionally, payload is not available. " + "Try calling 'exceptionResult' to see the cause of failure.", exception ); } return serializedPayload == null ? null : serializedPayload.getObject(); } GrpcBackedResponseMessage(QueryResponse queryResponse, Serializer serializer); private  GrpcBackedResponseMessage(QueryResponse queryResponse,
                                      LazyDeserializingObject<R> serializedPayload,
                                      Throwable exception,
                                      Supplier<MetaData> metaDataSupplier); @Override String getIdentifier(); @Override MetaData getMetaData(); @Override R getPayload(); @Override Class<R> getPayloadType(); @Override boolean isExceptional(); @Override Optional<Throwable> optionalExceptionResult(); @Override GrpcBackedResponseMessage<R> withMetaData(Map<String, ?> metaData); @Override GrpcBackedResponseMessage<R> andMetaData(Map<String, ?> metaData);  }