Package com.axway.ats.action.jms
Class JmsMessageVerification
- java.lang.Object
-
- com.axway.ats.action.jms.JmsMessageVerification
-
public class JmsMessageVerification extends Object
A utility class used to verify the content of a message received with the JMS client
-
-
Field Summary
Fields Modifier and Type Field Description static String
JMS_CORRELATION_ID
static String
JMS_DELIVERY_MODE
static String
JMS_DESTINATION
static String
JMS_EXPIRATION
static String
JMS_MESSAGE_ID
static String
JMS_PRIORITY
static String
JMS_REDELIVERED
static String
JMS_REPLY_TO
static String
JMS_TIMESTAMP
static String
JMS_TYPE
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description JmsMessageVerification
excludesProperties(String... names)
Does not include properties defined by their namesbyte[]
getBodyMD5()
JmsMessageVerification
hasBodyMD5(byte[] expectedDigest)
Has body MD5 sumJmsMessageVerification
hasBodyMD5(String expectedHexValue)
Has body MD5 sumJmsMessageVerification
hasProperties(Map<String,?> properties)
Has all properties with specified name and valueJmsMessageVerification
hasProperty(String name, Object... values)
Has a property with specified name and at lease one of the valuesJmsMessageVerification
hasText(String expectedText)
Contains the provided textJmsMessageVerification
includesProperties(String... names)
Includes all properties defined by their namesJmsMessageVerification
isBytesMessage()
It is a BYTES messageJmsMessageVerification
isMapMessage()
It is a MAP messageJmsMessageVerification
isNotNull()
Check the message is NOT NULLJmsMessageVerification
isNull()
Check the message is NULLJmsMessageVerification
isObjectMessage()
It is an OBJECT messageJmsMessageVerification
isStreamMessage()
It is a STREAM messageJmsMessageVerification
isTextMessage()
It is a TEXT messagestatic JmsMessageVerification
verifyThat(javax.jms.Message message)
Provides an instance of this class.
-
-
-
Field Detail
-
JMS_CORRELATION_ID
public static final String JMS_CORRELATION_ID
- See Also:
- Constant Field Values
-
JMS_DELIVERY_MODE
public static final String JMS_DELIVERY_MODE
- See Also:
- Constant Field Values
-
JMS_EXPIRATION
public static final String JMS_EXPIRATION
- See Also:
- Constant Field Values
-
JMS_PRIORITY
public static final String JMS_PRIORITY
- See Also:
- Constant Field Values
-
JMS_REDELIVERED
public static final String JMS_REDELIVERED
- See Also:
- Constant Field Values
-
JMS_REPLY_TO
public static final String JMS_REPLY_TO
- See Also:
- Constant Field Values
-
JMS_TIMESTAMP
public static final String JMS_TIMESTAMP
- See Also:
- Constant Field Values
-
JMS_TYPE
public static final String JMS_TYPE
- See Also:
- Constant Field Values
-
JMS_DESTINATION
public static final String JMS_DESTINATION
- See Also:
- Constant Field Values
-
JMS_MESSAGE_ID
public static final String JMS_MESSAGE_ID
- See Also:
- Constant Field Values
-
-
Method Detail
-
verifyThat
public static JmsMessageVerification verifyThat(javax.jms.Message message)
Provides an instance of this class. This methods is used instead of a constructor- Parameters:
message
- the message to work with- Returns:
- instance of this class
-
isNull
public JmsMessageVerification isNull()
Check the message is NULL- Returns:
-
isNotNull
public JmsMessageVerification isNotNull()
Check the message is NOT NULL- Returns:
-
isTextMessage
public JmsMessageVerification isTextMessage()
It is a TEXT message- Returns:
-
isBytesMessage
public JmsMessageVerification isBytesMessage()
It is a BYTES message- Returns:
-
isStreamMessage
public JmsMessageVerification isStreamMessage()
It is a STREAM message- Returns:
-
isMapMessage
public JmsMessageVerification isMapMessage()
It is a MAP message- Returns:
-
isObjectMessage
public JmsMessageVerification isObjectMessage()
It is an OBJECT message- Returns:
-
hasText
public JmsMessageVerification hasText(String expectedText) throws javax.jms.JMSException
Contains the provided text- Parameters:
expectedText
- the expected text- Returns:
- Throws:
javax.jms.JMSException
-
hasProperty
public JmsMessageVerification hasProperty(String name, Object... values)
Has a property with specified name and at lease one of the values- Parameters:
name
- property namevalues
- property value(s)- Returns:
-
hasProperties
public JmsMessageVerification hasProperties(Map<String,?> properties)
Has all properties with specified name and value- Parameters:
properties
- the expected properties- Returns:
-
includesProperties
public JmsMessageVerification includesProperties(String... names)
Includes all properties defined by their names- Parameters:
names
- property names- Returns:
-
excludesProperties
public JmsMessageVerification excludesProperties(String... names)
Does not include properties defined by their names- Parameters:
names
- property names- Returns:
-
getBodyMD5
public byte[] getBodyMD5()
- Returns:
- the body MD5 sum
-
hasBodyMD5
public JmsMessageVerification hasBodyMD5(byte[] expectedDigest)
Has body MD5 sum- Parameters:
expectedDigest
- expected MD5 sum- Returns:
-
hasBodyMD5
public JmsMessageVerification hasBodyMD5(String expectedHexValue)
Has body MD5 sum- Parameters:
expectedHexValue
- expected MD5 sum- Returns:
-
-