PROTON-2739 Add extra constructor to EncodedAmqpValue matcher
Add a constructor that accepts the AmqpValue type and will unwrap it for
the user to make test writing slightly less error prone.
diff --git a/protonj2-test-driver/src/main/java/org/apache/qpid/protonj2/test/driver/matchers/types/EncodedAmqpValueMatcher.java b/protonj2-test-driver/src/main/java/org/apache/qpid/protonj2/test/driver/matchers/types/EncodedAmqpValueMatcher.java
index 7819da1..f853475 100644
--- a/protonj2-test-driver/src/main/java/org/apache/qpid/protonj2/test/driver/matchers/types/EncodedAmqpValueMatcher.java
+++ b/protonj2-test-driver/src/main/java/org/apache/qpid/protonj2/test/driver/matchers/types/EncodedAmqpValueMatcher.java
@@ -29,6 +29,14 @@
private static final UnsignedLong DESCRIPTOR_CODE = UnsignedLong.valueOf(0x0000000000000077L);
/**
+ * @param expectedValueWrapper
+ * the {@link AmqpValue} whose payload is expected to be IN the received {@link AmqpValue}
+ */
+ public EncodedAmqpValueMatcher(AmqpValue expectedValueWrapper) {
+ this(expectedValueWrapper.getDescribed(), false);
+ }
+
+ /**
* @param expectedValue
* the value that is expected to be IN the received {@link AmqpValue}
*/
@@ -37,6 +45,17 @@
}
/**
+ * @param expectedValueWrapper
+ * the {@link AmqpValue} whose payload is expected to be IN the received {@link AmqpValue}
+ * @param permitTrailingBytes
+ * if it is permitted for bytes to be left in the Binary after
+ * consuming the {@link AmqpValue}
+ */
+ public EncodedAmqpValueMatcher(AmqpValue expectedValueWrapper, boolean permitTrailingBytes) {
+ this(expectedValueWrapper.getDescribed(), permitTrailingBytes);
+ }
+
+ /**
* @param expectedValue
* the value that is expected to be IN the received {@link AmqpValue}
* @param permitTrailingBytes