You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by ta...@apache.org on 2023/05/31 22:22:23 UTC
[qpid-protonj2] branch main updated: PROTON-2739 Add extra constructor to EncodedAmqpValue matcher
This is an automated email from the ASF dual-hosted git repository.
tabish pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/qpid-protonj2.git
The following commit(s) were added to refs/heads/main by this push:
new 927a08a9 PROTON-2739 Add extra constructor to EncodedAmqpValue matcher
927a08a9 is described below
commit 927a08a906194aa56780df37eca590440d15f3a9
Author: Timothy Bish <ta...@gmail.com>
AuthorDate: Wed May 31 18:22:13 2023 -0400
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.
---
.../matchers/types/EncodedAmqpValueMatcher.java | 19 +++++++++++++++++++
1 file changed, 19 insertions(+)
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 7819da1f..f8534754 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
@@ -28,6 +28,14 @@ public class EncodedAmqpValueMatcher extends EncodedAmqpTypeMatcher {
private static final Symbol DESCRIPTOR_SYMBOL = Symbol.valueOf("amqp:amqp-value:*");
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}
@@ -36,6 +44,17 @@ public class EncodedAmqpValueMatcher extends EncodedAmqpTypeMatcher {
this(expectedValue, false);
}
+ /**
+ * @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}
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org