@Test void testGetPayloadReturnsAnIdenticalObjectAsInsertedThroughTheQueryUpdate() { TestQueryUpdate expectedQueryUpdate = TEST_QUERY_UPDATE; SubscriptionQueryUpdateMessage<Object> testSubscriptionQueryUpdateMessage = GenericSubscriptionQueryUpdateMessage.asUpdateMessage(expectedQueryUpdate); QueryUpdate testQueryUpdate = subscriptionMessageSerializer.serialize(testSubscriptionQueryUpdateMessage); GrpcBackedQueryUpdateMessage<TestQueryUpdate> testSubject = new GrpcBackedQueryUpdateMessage<>(testQueryUpdate, serializer); assertEquals(expectedQueryUpdate, testSubject.getPayload()); }
@Override public U 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(); }
GrpcBackedQueryUpdateMessage implements SubscriptionQueryUpdateMessage<U> { @Override public U 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(); } }
GrpcBackedQueryUpdateMessage implements SubscriptionQueryUpdateMessage<U> { @Override public U 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(); } GrpcBackedQueryUpdateMessage(QueryUpdate queryUpdate, Serializer serializer); private  GrpcBackedQueryUpdateMessage(QueryUpdate queryUpdate,
                                         LazyDeserializingObject<U> serializedPayload,
                                         Throwable exception,
                                         Supplier<MetaData> metaDataSupplier); }
GrpcBackedQueryUpdateMessage implements SubscriptionQueryUpdateMessage<U> { @Override public U 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(); } GrpcBackedQueryUpdateMessage(QueryUpdate queryUpdate, Serializer serializer); private  GrpcBackedQueryUpdateMessage(QueryUpdate queryUpdate,
                                         LazyDeserializingObject<U> serializedPayload,
                                         Throwable exception,
                                         Supplier<MetaData> metaDataSupplier); @Override String getIdentifier(); @Override MetaData getMetaData(); @Override U getPayload(); @Override Class<U> getPayloadType(); @Override boolean isExceptional(); @Override Optional<Throwable> optionalExceptionResult(); @Override GrpcBackedQueryUpdateMessage<U> withMetaData(Map<String, ?> metaData); @Override GrpcBackedQueryUpdateMessage<U> andMetaData(Map<String, ?> metaData); }
GrpcBackedQueryUpdateMessage implements SubscriptionQueryUpdateMessage<U> { @Override public U 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(); } GrpcBackedQueryUpdateMessage(QueryUpdate queryUpdate, Serializer serializer); private  GrpcBackedQueryUpdateMessage(QueryUpdate queryUpdate,
                                         LazyDeserializingObject<U> serializedPayload,
                                         Throwable exception,
                                         Supplier<MetaData> metaDataSupplier); @Override String getIdentifier(); @Override MetaData getMetaData(); @Override U getPayload(); @Override Class<U> getPayloadType(); @Override boolean isExceptional(); @Override Optional<Throwable> optionalExceptionResult(); @Override GrpcBackedQueryUpdateMessage<U> withMetaData(Map<String, ?> metaData); @Override GrpcBackedQueryUpdateMessage<U> andMetaData(Map<String, ?> metaData);  }