ComponentsRule

class ComponentsRule : ValidationRule<Components> (source)

Functions

Link copied to clipboard
fun callbacks(description: String = "", rule: CallbacksRule.() -> CallbacksRule): ComponentsRule
Link copied to clipboard
fun <R : ValidationRule<Components>> R.either(vararg option: Components): 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<Components>> R.exactly(value: Components): R

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

Link copied to clipboard
fun examples(description: String = "", rule: ExamplesRule.() -> ExamplesRule): ComponentsRule
Link copied to clipboard
fun <R : ValidationRule<Components>> R.given(precondition: (Components?) -> Boolean, rule: R.() -> R): R

Validate rule only if precondition evaluates to true.

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

Validate that predicate evaluates to true.

Link copied to clipboard
fun links(description: String = "", rule: LinksRule.() -> LinksRule): ComponentsRule
Link copied to clipboard
fun <R : ValidationRule<Components>> R.not(message: String, rule: R.() -> R): R

Validate that the rule does not hold.

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

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

Link copied to clipboard
fun parameters(description: String = "", rule: ParametersRule.() -> ParametersRule): ComponentsRule
Link copied to clipboard
Link copied to clipboard
fun <R : ValidationRule<Components>> R.required(): R

Validate that the element is set.

Link copied to clipboard
fun responses(description: String = "", rule: ResponsesRule.() -> ResponsesRule): ComponentsRule
Link copied to clipboard
fun schemas(description: String = "", rule: SchemasRule.() -> SchemasRule): ComponentsRule
Link copied to clipboard
fun <R : ValidationRule<Components>> 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<Components>> R.unspecified(): R

Validate that the element is not set.

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

Execute the given rule(s) on the fixture.