public class RulesValidator extends Object implements MessageValidator
Modifier and Type | Field and Description |
---|---|
static String |
RULES_ORIGINAL_MESSAGE
Message property key set on the original message for the validator to denote the original message and its response.
|
Constructor and Description |
---|
RulesValidator() |
Modifier and Type | Method and Description |
---|---|
boolean |
isValid(Message originalMessage,
Message response,
Properties messageAttributes)
Makes sure the provided message is valid.
|
RulesValidator |
setRules(String validationRuleFile)
Sets the rules file from which the assertions are loaded.
|
void |
setRulesAsElement(Element validationRule)
Sets the rules based on an XML element holding the assertions.
|
public static final String RULES_ORIGINAL_MESSAGE
public boolean isValid(Message originalMessage, Message response, Properties messageAttributes)
MessageValidator
isValid
in interface MessageValidator
originalMessage
- The message that has been sent.response
- A response for the original message.messageAttributes
- A snapshot of sequences' values and possible other attributes used for sending a message. These attributes can be used by a validator to replace placeholders.true
if the message passes all validations.public RulesValidator setRules(String validationRuleFile)
validationRuleFile
- The file name of the assertions file.public void setRulesAsElement(Element validationRule)
validationRule
- The XML element with the assertions.Copyright © 2010–2017 PerfCake Community. All rights reserved.