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
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description ExpectationHandlerexpect()ExpectationHandlerexpect(boolean masterSwitch)static ExpectationHandlerexpectationHandler()IndividualExpectationthat(boolean active, boolean condition)An individual expectation from a call result.IndividualExpectationthat(boolean active, Method method, Object[] args)An individual expectation from a call result.
-
-
-
Method Detail
-
expectationHandler
public static ExpectationHandler expectationHandler()
- Returns:
- a DSL object to handle expectation operations.
-
expect
public ExpectationHandler expect()
- Specified by:
expectin interfaceAggregateExpectation
-
expect
public ExpectationHandler expect(boolean masterSwitch)
- Specified by:
expectin interfaceAggregateExpectation
-
that
public IndividualExpectation that(boolean active, boolean condition)
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
public IndividualExpectation that(boolean active, Method method, Object[] args)
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.
-
-