SecurityRequirementRule

class SecurityRequirementRule(group: RuleGroup = RuleGroup.unknown()) : IterableRule<Pair<String, List<String>>> (source)

Constructors

Link copied to clipboard
constructor(group: RuleGroup = RuleGroup.unknown())

Functions

Link copied to clipboard
Link copied to clipboard
fun <R : IterableRule<Pair<String, List<String>>>> R.each(description: String = "", predicate: (Pair<String, List<String>>) -> Boolean): R

Validate that all elements satisfy predicate.

Link copied to clipboard

Validate that the element should be equal to one of the elements in option given that it is set.

Link copied to clipboard

Validate that the element should be equal to value given that it is set.

Link copied to clipboard
fun <R : ValidationRule<Iterable<Pair<String, List<String>>>>> R.given(precondition: (Iterable<Pair<String, List<String>>>?) -> Boolean, rule: R.() -> R): R

Validate rule only if precondition evaluates to true.

Link copied to clipboard
fun <R : ValidationRule<Iterable<Pair<String, List<String>>>>> R.holds(message: (Iterable<Pair<String, List<String>>>?) -> String = { "Was supposed to hold for '$it' but did not" }, predicate: (Iterable<Pair<String, List<String>>>?) -> Boolean): R

Validate that predicate evaluates to true.

Link copied to clipboard
fun <R : IterableRule<Pair<String, List<String>>>> R.none(description: String = "", predicate: (Pair<String, List<String>>) -> Boolean): R

Validate that no element satisfies predicate.

Link copied to clipboard
fun <R : ValidationRule<Iterable<Pair<String, List<String>>>>> R.not(message: String, rule: R.() -> R): R

Validate that the rule does not hold.

Link copied to clipboard
fun <V, R : ValidationRule<Iterable<Pair<String, List<String>>>>> R.optional(value: (Iterable<Pair<String, List<String>>>?) -> V?, rule: R.() -> R): R

Validate rule only if the evaluated result of value is not null.

Link copied to clipboard

Validate that the element is set.

Link copied to clipboard
Link copied to clipboard
fun <R : ValidationRule<Iterable<Pair<String, List<String>>>>> R.since(date: LocalDate, rule: R.() -> R): R

Validate rule only if date has been in the past.

Link copied to clipboard
fun <R : IterableRule<Pair<String, List<String>>>> R.some(description: String = "", predicate: (Pair<String, List<String>>) -> Boolean): R

Validate that at least one element satisfies predicate.

Link copied to clipboard

Validate that the element is not set.

Link copied to clipboard

Execute the given rule(s) on the fixture.