@Test void testIllegalAccessPayloadWhenResultIsExceptional() { QueryResponseMessage<?> msg = GenericQueryResponseMessage.asResponseMessage(List.class, new RuntimeException()); QueryResponseMessage<List<String>> wrapped = new ConvertingResponseMessage<>( ResponseTypes.multipleInstancesOf(String.class), msg); assertEquals(List.class, wrapped.getPayloadType()); assertThrows(IllegalPayloadAccessException.class, wrapped::getPayload); }
@Override public Class<R> getPayloadType() { return expectedResponseType.responseMessagePayloadType(); }
ConvertingResponseMessage implements QueryResponseMessage<R> { @Override public Class<R> getPayloadType() { return expectedResponseType.responseMessagePayloadType(); } }
ConvertingResponseMessage implements QueryResponseMessage<R> { @Override public Class<R> getPayloadType() { return expectedResponseType.responseMessagePayloadType(); } ConvertingResponseMessage(ResponseType<R> expectedResponseType,
                                     QueryResponseMessage<?> responseMessage); }
ConvertingResponseMessage implements QueryResponseMessage<R> { @Override public Class<R> getPayloadType() { return expectedResponseType.responseMessagePayloadType(); } ConvertingResponseMessage(ResponseType<R> expectedResponseType,
                                     QueryResponseMessage<?> responseMessage); @Override SerializedObject<S> serializePayload(Serializer serializer, Class<S> expectedRepresentation); @Override SerializedObject<T> serializeExceptionResult(Serializer serializer, Class<T> expectedRepresentation); @Override SerializedObject<R1> serializeMetaData(Serializer serializer, Class<R1> expectedRepresentation); @Override boolean isExceptional(); @Override Optional<Throwable> optionalExceptionResult(); @Override String getIdentifier(); @Override MetaData getMetaData(); @Override R getPayload(); @Override Class<R> getPayloadType(); @Override QueryResponseMessage<R> withMetaData(Map<String, ?> metaData); @Override QueryResponseMessage<R> andMetaData(Map<String, ?> additionalMetaData); }
ConvertingResponseMessage implements QueryResponseMessage<R> { @Override public Class<R> getPayloadType() { return expectedResponseType.responseMessagePayloadType(); } ConvertingResponseMessage(ResponseType<R> expectedResponseType,
                                     QueryResponseMessage<?> responseMessage); @Override SerializedObject<S> serializePayload(Serializer serializer, Class<S> expectedRepresentation); @Override SerializedObject<T> serializeExceptionResult(Serializer serializer, Class<T> expectedRepresentation); @Override SerializedObject<R1> serializeMetaData(Serializer serializer, Class<R1> expectedRepresentation); @Override boolean isExceptional(); @Override Optional<Throwable> optionalExceptionResult(); @Override String getIdentifier(); @Override MetaData getMetaData(); @Override R getPayload(); @Override Class<R> getPayloadType(); @Override QueryResponseMessage<R> withMetaData(Map<String, ?> metaData); @Override QueryResponseMessage<R> andMetaData(Map<String, ?> additionalMetaData);  }