Package com.consol.citrus.validation
Interface ValueMatcher
-
public interface ValueMatcher- Author:
- Christoph Deppisch
-
-
Field Summary
Fields Modifier and Type Field Description static org.slf4j.LoggerLOGLoggerstatic StringRESOURCE_PATHMessage validator resource lookup pathstatic TypeResolverTYPE_RESOLVERType resolver to find custom message validators on classpath via resource path lookupstatic Map<String,ValueMatcher>validators
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description static Map<String,ValueMatcher>lookup()Resolves all available validators from resource path lookup.static Optional<ValueMatcher>lookup(String validator)Resolves validator from resource path lookup with given validator resource name.booleansupports(Class<?> controlType)Filter supported value typesbooleanvalidate(Object received, Object control, TestContext context)Value matcher verifies the match of given received and control values.
-
-
-
Field Detail
-
LOG
static final org.slf4j.Logger LOG
Logger
-
RESOURCE_PATH
static final String RESOURCE_PATH
Message validator resource lookup path- See Also:
- Constant Field Values
-
TYPE_RESOLVER
static final TypeResolver TYPE_RESOLVER
Type resolver to find custom message validators on classpath via resource path lookup
-
validators
static final Map<String,ValueMatcher> validators
-
-
Method Detail
-
lookup
static Map<String,ValueMatcher> lookup()
Resolves all available validators from resource path lookup. Scans classpath for validator meta information and instantiates those validators.- Returns:
-
lookup
static Optional<ValueMatcher> lookup(String validator)
Resolves validator from resource path lookup with given validator resource name. Scans classpath for validator meta information with given name and returns instance of validator. Returns optional instead of throwing exception when no validator could be found.- Parameters:
validator-- Returns:
-
supports
boolean supports(Class<?> controlType)
Filter supported value types- Parameters:
controlType-- Returns:
-
validate
boolean validate(Object received, Object control, TestContext context)
Value matcher verifies the match of given received and control values.- Parameters:
received-control-context-
-
-