Class ExpectationHandler
java.lang.Object
org.evomaster.client.java.controller.expect.ExpectationHandler
- All Implemented Interfaces:
AggregateExpectation,IndividualExpectation
public class ExpectationHandler
extends Object
implements AggregateExpectation, IndividualExpectation
DSL (Domain Specific Language) for expectation management.
The goal is to allow checks on the truth value, results, and contents
of specific calls.
If expectations are active, a failed condition will
raise an exception.
If expectations are not active, no exception will be raised regardless
of the truth value of the condition.
WiP: A more finely grained mechanism for activation is planned.
The goal is to allow activating and deactivating specific types of
expectations.
-
Method Summary
Modifier and TypeMethodDescriptionexpect()expect(boolean masterSwitch) static ExpectationHandlerthat(boolean active, boolean condition) An individual expectation from a call result.An individual expectation from a call result.
-
Method Details
-
expectationHandler
- Returns:
- a DSL object to handle expectation operations.
-
expect
- Specified by:
expectin interfaceAggregateExpectation
-
expect
- Specified by:
expectin interfaceAggregateExpectation
-
that
Description copied from interface:IndividualExpectationAn individual expectation from a call result.- Specified by:
thatin interfaceIndividualExpectation- Parameters:
active- is the expectation active. If active, and the condition is false, an Exception will be raised.condition- is the condition to be checked. If the expectation is not [active], the truth value of the condition is not relevant. Additional functions can/will be developed.
-
that
Description copied from interface:IndividualExpectationAn individual expectation from a call result.- Specified by:
thatin interfaceIndividualExpectation- Parameters:
active- is the expectation active. If active, and the condition is false, an Exception will be raised.method- is should be invoked if active (and any other conditions are met). The idea is to allow the use of Hamcrest Matchers and Rest Assured assertions. Additional functions can/will be developed.
-