LinkRule

class LinkRule(group: RuleGroup = RuleGroup.unknown()) : ValidationRule<Link> (source)

Constructors

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

Functions

Link copied to clipboard
fun description(description: String = "", rule: StringRule.() -> StringRule): LinkRule
Link copied to clipboard
fun <R : ValidationRule<Link>> R.either(vararg option: Link): R

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

Link copied to clipboard
fun <R : ValidationRule<Link>> R.exactly(value: Link): R

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

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

Validate rule only if precondition evaluates to true.

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

Validate that predicate evaluates to true.

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

Validate that the rule does not hold.

Link copied to clipboard
fun operationId(description: String = "", rule: StringRule.() -> StringRule): LinkRule
Link copied to clipboard
fun operationRef(description: String = "", rule: StringRule.() -> StringRule): LinkRule
Link copied to clipboard
fun <V, R : ValidationRule<Link>> R.optional(value: (Link?) -> V?, rule: R.() -> R): R

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

Link copied to clipboard
fun requestBody(description: String = "", rule: AnyRule.() -> AnyRule): LinkRule
Link copied to clipboard
fun <R : ValidationRule<Link>> R.required(): R

Validate that the element is set.

Link copied to clipboard
fun server(description: String = "", rule: ServerRule.() -> ServerRule): LinkRule
Link copied to clipboard
fun <R : ValidationRule<Link>> R.since(date: LocalDate, rule: R.() -> R): R

Validate rule only if date has been in the past.

Link copied to clipboard
fun <R : ValidationRule<Link>> R.unspecified(): R

Validate that the element is not set.

Link copied to clipboard
fun validate(fixture: Link?): ValidationResult

Execute the given rule(s) on the fixture.