Interface SingleConstraintAssertion
- All Known Subinterfaces:
ShadowVariableAwareSingleConstraintAssertion
- All Known Implementing Classes:
AbstractSingleConstraintAssertion,DefaultShadowVariableAwareSingleConstraintAssertion,DefaultSingleConstraintAssertion
-
Method Summary
Modifier and TypeMethodDescriptiondefault @NonNull SingleConstraintAssertionindictsWith(@NonNull Object @NonNull ... indictments) Asserts that theConstraintbeing tested, given a set of facts, results in the given indictments.@NonNull SingleConstraintAssertionindictsWith(@Nullable String message, @NonNull Object @NonNull ... indictments) As defined byindictsWith(Object...).default @NonNull SingleConstraintAssertionindictsWithExactly(@NonNull Object @NonNull ... indictments) Asserts that theConstraintbeing tested, given a set of facts, results in the given indictments and nothing else.@NonNull SingleConstraintAssertionindictsWithExactly(@Nullable String message, @NonNull Object @NonNull ... indictments) As defined byindictsWithExactly(Object...).default @NonNull SingleConstraintAssertionjustifiesWith(@NonNull ConstraintJustification @NonNull ... justifications) Asserts that theConstraintbeing tested, given a set of facts, results in a givenConstraintJustification.@NonNull SingleConstraintAssertionjustifiesWith(@Nullable String message, @NonNull ConstraintJustification @NonNull ... justifications) As defined byjustifiesWith(ConstraintJustification...).default @NonNull SingleConstraintAssertionjustifiesWithExactly(@NonNull ConstraintJustification @NonNull ... justifications) Asserts that theConstraintbeing tested, given a set of facts, results in a givenConstraintJustificationand nothing else.@NonNull SingleConstraintAssertionjustifiesWithExactly(@Nullable String message, @NonNull ConstraintJustification @NonNull ... justifications) As defined byjustifiesWithExactly(ConstraintJustification...).default voidAsserts that theConstraintbeing tested, given a set of facts, results in any number of penalties.default voidpenalizes(long times) Asserts that theConstraintbeing tested, given a set of facts, results in a given number of penalties.default voidDeprecated, for removal: This API element is subject to removal in a future version.voidAs defined bypenalizes().voidAs defined bypenalizes(long).default voidpenalizesBy(int matchWeightTotal) Asserts that theConstraintbeing tested, given a set of facts, results in a specific penalty.default voidpenalizesBy(int matchWeightTotal, String message) Deprecated, for removal: This API element is subject to removal in a future version.UsepenalizesBy(String, int)instead.default voidpenalizesBy(long matchWeightTotal) As defined bypenalizesBy(int).default voidpenalizesBy(long matchWeightTotal, String message) Deprecated, for removal: This API element is subject to removal in a future version.UsepenalizesBy(String, long)instead.default voidpenalizesBy(@NonNull BigDecimal matchWeightTotal) As defined bypenalizesBy(long).voidpenalizesBy(@Nullable String message, int matchWeightTotal) As defined bypenalizesBy(int).voidpenalizesBy(@Nullable String message, long matchWeightTotal) As defined bypenalizesBy(long).voidpenalizesBy(@Nullable String message, @NonNull BigDecimal matchWeightTotal) As defined bypenalizesBy(BigDecimal).default voidpenalizesBy(BigDecimal matchWeightTotal, String message) Deprecated, for removal: This API element is subject to removal in a future version.UsepenalizesBy(String, BigDecimal)instead.default voidpenalizesByLessThan(int matchWeightTotal) Asserts that theConstraintbeing tested, given a set of facts, results in a specific penalty smaller than given.default voidpenalizesByLessThan(long matchWeightTotal) As defined bypenalizesByLessThan(int).default voidpenalizesByLessThan(@NonNull BigDecimal matchWeightTotal) As defined bypenalizesByLessThan(long).voidpenalizesByLessThan(@Nullable String message, int matchWeightTotal) As defined bypenalizesByLessThan(int).voidpenalizesByLessThan(@Nullable String message, long matchWeightTotal) As defined bypenalizesByLessThan(long).voidpenalizesByLessThan(@Nullable String message, @NonNull BigDecimal matchWeightTotal) As defined bypenalizesByLessThan(BigDecimal).default voidpenalizesByMoreThan(int matchWeightTotal) Asserts that theConstraintbeing tested, given a set of facts, results in a specific penalty larger than given.default voidpenalizesByMoreThan(long matchWeightTotal) As defined bypenalizesByMoreThan(int).default voidpenalizesByMoreThan(@NonNull BigDecimal matchWeightTotal) As defined bypenalizesByMoreThan(long).voidpenalizesByMoreThan(@Nullable String message, int matchWeightTotal) As defined bypenalizesByMoreThan(int).voidpenalizesByMoreThan(@Nullable String message, long matchWeightTotal) As defined bypenalizesByMoreThan(long).voidpenalizesByMoreThan(@Nullable String message, @NonNull BigDecimal matchWeightTotal) As defined bypenalizesByMoreThan(BigDecimal).default voidpenalizesLessThan(long times) Asserts that theConstraintbeing tested, given a set of facts, results in a number of rewards smaller than given.voidpenalizesLessThan(@Nullable String message, long times) As defined bypenalizesLessThan(long).default voidpenalizesMoreThan(long times) Asserts that theConstraintbeing tested, given a set of facts, results in a number of rewards larger than given.voidpenalizesMoreThan(@Nullable String message, long times) As defined bypenalizesMoreThan(long).default voidrewards()Asserts that theConstraintbeing tested, given a set of facts, results in any number of rewards.default voidrewards(long times) Asserts that theConstraintbeing tested, given a set of facts, results in a given number of rewards.default voidDeprecated, for removal: This API element is subject to removal in a future version.Userewards(String, long)instead.voidAs defined byrewards().voidAs defined byrewards(long).default voidrewardsLessThan(long times) Asserts that theConstraintbeing tested, given a set of facts, results in a number of rewards smaller than given.voidrewardsLessThan(@Nullable String message, long times) As defined byrewardsLessThan(long).default voidrewardsMoreThan(long times) Asserts that theConstraintbeing tested, given a set of facts, results in a number of rewards larger than given.voidrewardsMoreThan(@Nullable String message, long times) As defined byrewardsMoreThan(long).default voidrewardsWith(int matchWeightTotal) Asserts that theConstraintbeing tested, given a set of facts, results in a specific reward.default voidrewardsWith(int matchWeightTotal, String message) Deprecated, for removal: This API element is subject to removal in a future version.UserewardsWith(String, int)instead.default voidrewardsWith(long matchWeightTotal) As defined byrewardsWith(int).default voidrewardsWith(long matchWeightTotal, String message) Deprecated, for removal: This API element is subject to removal in a future version.UserewardsWith(String, long)instead.default voidrewardsWith(@NonNull BigDecimal matchWeightTotal) As defined byrewardsWith(int).voidrewardsWith(@Nullable String message, int matchWeightTotal) As defined byrewardsWith(int).voidrewardsWith(@Nullable String message, long matchWeightTotal) As defined byrewardsWith(long).voidrewardsWith(@Nullable String message, @NonNull BigDecimal matchWeightTotal) As defined byrewardsWith(BigDecimal).default voidrewardsWith(BigDecimal matchWeightTotal, String message) Deprecated, for removal: This API element is subject to removal in a future version.UserewardsWith(String, BigDecimal)instead.default voidrewardsWithLessThan(int matchWeightTotal) Asserts that theConstraintbeing tested, given a set of facts, results in a specific reward smaller than given.default voidrewardsWithLessThan(long matchWeightTotal) As defined byrewardsWithLessThan(int).default voidrewardsWithLessThan(@NonNull BigDecimal matchWeightTotal) As defined byrewardsWithLessThan(int).voidrewardsWithLessThan(@Nullable String message, int matchWeightTotal) As defined byrewardsWithLessThan(int).voidrewardsWithLessThan(@Nullable String message, long matchWeightTotal) As defined byrewardsWithLessThan(long).voidrewardsWithLessThan(@Nullable String message, @NonNull BigDecimal matchWeightTotal) As defined byrewardsWithLessThan(BigDecimal).default voidrewardsWithMoreThan(int matchWeightTotal) Asserts that theConstraintbeing tested, given a set of facts, results in a specific reward larger than given.default voidrewardsWithMoreThan(long matchWeightTotal) As defined byrewardsWithMoreThan(int).default voidrewardsWithMoreThan(@NonNull BigDecimal matchWeightTotal) As defined byrewardsWithMoreThan(int).voidrewardsWithMoreThan(@Nullable String message, int matchWeightTotal) As defined byrewardsWithMoreThan(int).voidrewardsWithMoreThan(@Nullable String message, long matchWeightTotal) As defined byrewardsWithMoreThan(long).voidrewardsWithMoreThan(@Nullable String message, @NonNull BigDecimal matchWeightTotal) As defined byrewardsWithMoreThan(BigDecimal).
-
Method Details
-
justifiesWith
@NonNull SingleConstraintAssertion justifiesWith(@Nullable String message, @NonNull ConstraintJustification @NonNull ... justifications) As defined byjustifiesWith(ConstraintJustification...).- Parameters:
justifications- the expected justification.message- description of the scenario being asserted- Throws:
AssertionError- when the expected penalty is not observed
-
justifiesWith
default @NonNull SingleConstraintAssertion justifiesWith(@NonNull ConstraintJustification @NonNull ... justifications) Asserts that theConstraintbeing tested, given a set of facts, results in a givenConstraintJustification.- Parameters:
justifications- the expected justifications.- Throws:
AssertionError- when the expected penalty is not observed
-
justifiesWithExactly
@NonNull SingleConstraintAssertion justifiesWithExactly(@Nullable String message, @NonNull ConstraintJustification @NonNull ... justifications) As defined byjustifiesWithExactly(ConstraintJustification...).- Parameters:
justifications- the expected justification.message- description of the scenario being asserted- Throws:
AssertionError- when the expected penalty is not observed
-
justifiesWithExactly
default @NonNull SingleConstraintAssertion justifiesWithExactly(@NonNull ConstraintJustification @NonNull ... justifications) Asserts that theConstraintbeing tested, given a set of facts, results in a givenConstraintJustificationand nothing else.- Parameters:
justifications- the expected justifications.- Throws:
AssertionError- when the expected penalty is not observed
-
indictsWith
Asserts that theConstraintbeing tested, given a set of facts, results in the given indictments.- Parameters:
indictments- the expected indictments.- Throws:
AssertionError- when the expected penalty is not observed
-
indictsWith
@NonNull SingleConstraintAssertion indictsWith(@Nullable String message, @NonNull Object @NonNull ... indictments) As defined byindictsWith(Object...).- Parameters:
message- description of the scenario being assertedindictments- the expected indictments.- Throws:
AssertionError- when the expected penalty is not observed
-
indictsWithExactly
default @NonNull SingleConstraintAssertion indictsWithExactly(@NonNull Object @NonNull ... indictments) Asserts that theConstraintbeing tested, given a set of facts, results in the given indictments and nothing else.- Parameters:
indictments- the expected indictments.- Throws:
AssertionError- when the expected penalty is not observed
-
indictsWithExactly
@NonNull SingleConstraintAssertion indictsWithExactly(@Nullable String message, @NonNull Object @NonNull ... indictments) As defined byindictsWithExactly(Object...).- Parameters:
message- description of the scenario being assertedindictments- the expected indictments.- Throws:
AssertionError- when the expected penalty is not observed
-
penalizesBy
default void penalizesBy(int matchWeightTotal) Asserts that theConstraintbeing tested, given a set of facts, results in a specific penalty.Ignores the constraint weight: it only asserts the match weights. For example: a match with a match weight of
10on a constraint with a constraint weight of-2hardreduces the score by-20hard. In that case, this assertion checks for10.An
int matchWeightTotalautomatically casts tolongforlong scores.- Parameters:
matchWeightTotal- at least 0, expected sum of match weights of matches of the constraint.- Throws:
AssertionError- when the expected penalty is not observed
-
penalizesBy
@Deprecated(forRemoval=true, since="1.8.0") default void penalizesBy(int matchWeightTotal, String message) Deprecated, for removal: This API element is subject to removal in a future version.UsepenalizesBy(String, int)instead.As defined bypenalizesBy(int).- Parameters:
matchWeightTotal- at least 0, expected sum of match weights of matches of the constraint.message- sometimes null, description of the scenario being asserted- Throws:
AssertionError- when the expected penalty is not observed
-
penalizesBy
As defined bypenalizesBy(int).- Parameters:
message- description of the scenario being assertedmatchWeightTotal- at least 0, expected sum of match weights of matches of the constraint.- Throws:
AssertionError- when the expected penalty is not observed
-
penalizesBy
default void penalizesBy(long matchWeightTotal) As defined bypenalizesBy(int).- Parameters:
matchWeightTotal- at least 0, expected sum of match weights of matches of the constraint.- Throws:
AssertionError- when the expected penalty is not observed
-
penalizesBy
@Deprecated(forRemoval=true, since="1.8.0") default void penalizesBy(long matchWeightTotal, String message) Deprecated, for removal: This API element is subject to removal in a future version.UsepenalizesBy(String, long)instead.As defined bypenalizesBy(long).- Parameters:
matchWeightTotal- at least 0, expected sum of match weights of matches of the constraint.message- sometimes null, description of the scenario being asserted- Throws:
AssertionError- when the expected penalty is not observed
-
penalizesBy
As defined bypenalizesBy(long).- Parameters:
message- description of the scenario being assertedmatchWeightTotal- at least 0, expected sum of match weights of matches of the constraint.- Throws:
AssertionError- when the expected penalty is not observed
-
penalizesBy
As defined bypenalizesBy(long).- Parameters:
matchWeightTotal- at least 0, expected sum of match weights of matches of the constraint.- Throws:
AssertionError- when the expected penalty is not observed
-
penalizesBy
@Deprecated(forRemoval=true, since="1.8.0") default void penalizesBy(BigDecimal matchWeightTotal, String message) Deprecated, for removal: This API element is subject to removal in a future version.UsepenalizesBy(String, BigDecimal)instead.As defined bypenalizesBy(BigDecimal).- Parameters:
matchWeightTotal- at least 0, expected sum of match weights of matches of the constraint.message- sometimes null, description of the scenario being asserted- Throws:
AssertionError- when the expected penalty is not observed
-
penalizesBy
As defined bypenalizesBy(BigDecimal).- Parameters:
message- description of the scenario being assertedmatchWeightTotal- at least 0, expected sum of match weights of matches of the constraint.- Throws:
AssertionError- when the expected penalty is not observed
-
penalizes
default void penalizes(long times) Asserts that theConstraintbeing tested, given a set of facts, results in a given number of penalties.Ignores the constraint and match weights: it only asserts the number of matches For example: if there are two matches with weight of
10each, this assertion will check for 2 matches.- Parameters:
times- at least 0, expected number of times that the constraint will penalize- Throws:
AssertionError- when the expected penalty is not observed
-
penalizes
Deprecated, for removal: This API element is subject to removal in a future version.Usepenalizes(String, long)instead.As defined bypenalizes(long).- Parameters:
times- at least 0, expected number of times that the constraint will penalizemessage- sometimes null, description of the scenario being asserted- Throws:
AssertionError- when the expected penalty is not observed
-
penalizes
As defined bypenalizes(long).- Parameters:
message- description of the scenario being assertedtimes- at least 0, expected number of times that the constraint will penalize- Throws:
AssertionError- when the expected penalty is not observed
-
penalizes
default void penalizes()Asserts that theConstraintbeing tested, given a set of facts, results in any number of penalties.Ignores the constraint and match weights: it only asserts the number of matches For example: if there are two matches with weight of
10each, this assertion will succeed. If there are no matches, it will fail.- Throws:
AssertionError- when there are no penalties
-
penalizes
As defined bypenalizes().- Parameters:
message- description of the scenario being asserted- Throws:
AssertionError- when there are no penalties
-
rewardsWith
default void rewardsWith(int matchWeightTotal) Asserts that theConstraintbeing tested, given a set of facts, results in a specific reward.Ignores the constraint weight: it only asserts the match weights. For example: a match with a match weight of
10on a constraint with a constraint weight of-2hardreduces the score by-20hard. In that case, this assertion checks for10.An
int matchWeightTotalautomatically casts tolongforlong scores.- Parameters:
matchWeightTotal- at least 0, expected sum of match weights of matches of the constraint.- Throws:
AssertionError- when the expected reward is not observed
-
rewardsWith
@Deprecated(forRemoval=true, since="1.8.0") default void rewardsWith(int matchWeightTotal, String message) Deprecated, for removal: This API element is subject to removal in a future version.UserewardsWith(String, int)instead.As defined byrewardsWith(int).- Parameters:
matchWeightTotal- at least 0, expected sum of match weights of matches of the constraint.message- sometimes null, description of the scenario being asserted- Throws:
AssertionError- when the expected reward is not observed
-
rewardsWith
As defined byrewardsWith(int).- Parameters:
message- description of the scenario being assertedmatchWeightTotal- at least 0, expected sum of match weights of matches of the constraint.- Throws:
AssertionError- when the expected reward is not observed
-
rewardsWith
default void rewardsWith(long matchWeightTotal) As defined byrewardsWith(int).- Parameters:
matchWeightTotal- at least 0, expected sum of match weights of matches of the constraint.- Throws:
AssertionError- when the expected reward is not observed
-
rewardsWith
@Deprecated(forRemoval=true, since="1.8.0") default void rewardsWith(long matchWeightTotal, String message) Deprecated, for removal: This API element is subject to removal in a future version.UserewardsWith(String, long)instead.As defined byrewardsWith(long).- Parameters:
matchWeightTotal- at least 0, expected sum of match weights of matches of the constraint.message- sometimes null, description of the scenario being asserted- Throws:
AssertionError- when the expected reward is not observed
-
rewardsWith
As defined byrewardsWith(long).- Parameters:
message- description of the scenario being assertedmatchWeightTotal- at least 0, expected sum of match weights of matches of the constraint.- Throws:
AssertionError- when the expected reward is not observed
-
rewardsWith
As defined byrewardsWith(int).- Parameters:
matchWeightTotal- at least 0, expected sum of match weights of matches of the constraint.- Throws:
AssertionError- when the expected reward is not observed
-
rewardsWith
@Deprecated(forRemoval=true, since="1.8.0") default void rewardsWith(BigDecimal matchWeightTotal, String message) Deprecated, for removal: This API element is subject to removal in a future version.UserewardsWith(String, BigDecimal)instead.As defined byrewardsWith(BigDecimal).- Parameters:
matchWeightTotal- at least 0, expected sum of match weights of matches of the constraint.message- sometimes null, description of the scenario being asserted- Throws:
AssertionError- when the expected reward is not observed
-
rewardsWith
As defined byrewardsWith(BigDecimal).- Parameters:
message- description of the scenario being assertedmatchWeightTotal- at least 0, expected sum of match weights of matches of the constraint.- Throws:
AssertionError- when the expected reward is not observed
-
rewards
default void rewards(long times) Asserts that theConstraintbeing tested, given a set of facts, results in a given number of rewards.Ignores the constraint and match weights: it only asserts the number of matches For example: if there are two matches with weight of
10each, this assertion will check for 2 matches.- Parameters:
times- at least 0, expected number of times that the constraint will reward- Throws:
AssertionError- when the expected reward is not observed
-
rewards
Deprecated, for removal: This API element is subject to removal in a future version.Userewards(String, long)instead.As defined byrewards(long).- Parameters:
times- at least 0, expected number of times that the constraint will rewardmessage- sometimes null, description of the scenario being asserted- Throws:
AssertionError- when the expected reward is not observed
-
rewards
As defined byrewards(long).- Parameters:
message- description of the scenario being assertedtimes- at least 0, expected number of times that the constraint will reward- Throws:
AssertionError- when the expected reward is not observed
-
rewards
default void rewards()Asserts that theConstraintbeing tested, given a set of facts, results in any number of rewards.Ignores the constraint and match weights: it only asserts the number of matches For example: if there are two matches with weight of
10each, this assertion will succeed. If there are no matches, it will fail.- Throws:
AssertionError- when there are no rewards
-
rewards
As defined byrewards().- Parameters:
message- description of the scenario being asserted- Throws:
AssertionError- when there are no rewards
-
penalizesByMoreThan
default void penalizesByMoreThan(int matchWeightTotal) Asserts that theConstraintbeing tested, given a set of facts, results in a specific penalty larger than given.Ignores the constraint weight: it only asserts the match weights. For example: a match with a match weight of
10on a constraint with a constraint weight of-2hardreduces the score by-20hard. In that case, this assertion checks for10.An
int matchWeightTotalautomatically casts tolongforlong scores.- Parameters:
matchWeightTotal- at least 0, expected sum of match weights of matches of the constraint.- Throws:
AssertionError- when the expected penalty is not observed
-
penalizesByMoreThan
As defined bypenalizesByMoreThan(int).- Parameters:
message- description of the scenario being assertedmatchWeightTotal- at least 0, expected sum of match weights of matches of the constraint.- Throws:
AssertionError- when the expected penalty is not observed
-
penalizesByMoreThan
default void penalizesByMoreThan(long matchWeightTotal) As defined bypenalizesByMoreThan(int).- Parameters:
matchWeightTotal- at least 0, expected sum of match weights of matches of the constraint.- Throws:
AssertionError- when the expected penalty is not observed
-
penalizesByMoreThan
As defined bypenalizesByMoreThan(long).- Parameters:
message- description of the scenario being assertedmatchWeightTotal- at least 0, expected sum of match weights of matches of the constraint.- Throws:
AssertionError- when the expected penalty is not observed
-
penalizesByMoreThan
As defined bypenalizesByMoreThan(long).- Parameters:
matchWeightTotal- at least 0, expected sum of match weights of matches of the constraint.- Throws:
AssertionError- when the expected penalty is not observed
-
penalizesByMoreThan
As defined bypenalizesByMoreThan(BigDecimal).- Parameters:
message- description of the scenario being assertedmatchWeightTotal- at least 0, expected sum of match weights of matches of the constraint.- Throws:
AssertionError- when the expected penalty is not observed
-
penalizesMoreThan
default void penalizesMoreThan(long times) Asserts that theConstraintbeing tested, given a set of facts, results in a number of rewards larger than given.Ignores the constraint and match weights: it only asserts the number of matches. For example: if there are two matches with weight of
10each, this assertion will check for 2 matches.- Parameters:
times- at least 0, expected number of times that the constraint will penalize- Throws:
AssertionError- when the expected penalty is not observed
-
penalizesMoreThan
As defined bypenalizesMoreThan(long).- Parameters:
message- description of the scenario being assertedtimes- at least 0, expected number of times that the constraint will penalize- Throws:
AssertionError- when the expected penalty is not observed
-
rewardsWithMoreThan
default void rewardsWithMoreThan(int matchWeightTotal) Asserts that theConstraintbeing tested, given a set of facts, results in a specific reward larger than given.Ignores the constraint weight: it only asserts the match weights. For example: a match with a match weight of
10on a constraint with a constraint weight of-2hardreduces the score by-20hard. In that case, this assertion checks for10.An
int matchWeightTotalautomatically casts tolongforlong scores.- Parameters:
matchWeightTotal- at least 0, expected sum of match weights of matches of the constraint.- Throws:
AssertionError- when the expected reward is not observed
-
rewardsWithMoreThan
As defined byrewardsWithMoreThan(int).- Parameters:
message- description of the scenario being assertedmatchWeightTotal- at least 0, expected sum of match weights of matches of the constraint.- Throws:
AssertionError- when the expected reward is not observed
-
rewardsWithMoreThan
default void rewardsWithMoreThan(long matchWeightTotal) As defined byrewardsWithMoreThan(int).- Parameters:
matchWeightTotal- at least 0, expected sum of match weights of matches of the constraint.- Throws:
AssertionError- when the expected reward is not observed
-
rewardsWithMoreThan
As defined byrewardsWithMoreThan(long).- Parameters:
message- description of the scenario being assertedmatchWeightTotal- at least 0, expected sum of match weights of matches of the constraint.- Throws:
AssertionError- when the expected reward is not observed
-
rewardsWithMoreThan
As defined byrewardsWithMoreThan(int).- Parameters:
matchWeightTotal- at least 0, expected sum of match weights of matches of the constraint.- Throws:
AssertionError- when the expected reward is not observed
-
rewardsWithMoreThan
As defined byrewardsWithMoreThan(BigDecimal).- Parameters:
message- description of the scenario being assertedmatchWeightTotal- at least 0, expected sum of match weights of matches of the constraint.- Throws:
AssertionError- when the expected reward is not observed
-
rewardsMoreThan
default void rewardsMoreThan(long times) Asserts that theConstraintbeing tested, given a set of facts, results in a number of rewards larger than given.Ignores the constraint and match weights: it only asserts the number of matches For example: if there are two matches with weight of
10each, this assertion will check for 2 matches.- Parameters:
times- at least 0, expected number of times that the constraint will reward- Throws:
AssertionError- when the expected reward is not observed
-
rewardsMoreThan
As defined byrewardsMoreThan(long).- Parameters:
message- description of the scenario being assertedtimes- at least 0, expected number of times that the constraint will reward- Throws:
AssertionError- when the expected reward is not observed
-
penalizesByLessThan
default void penalizesByLessThan(int matchWeightTotal) Asserts that theConstraintbeing tested, given a set of facts, results in a specific penalty smaller than given.Ignores the constraint weight: it only asserts the match weights. For example: a match with a match weight of
10on a constraint with a constraint weight of-2hardreduces the score by-20hard. In that case, this assertion checks for10.An
int matchWeightTotalautomatically casts tolongforlong scores.- Parameters:
matchWeightTotal- at least 1, expected sum of match weights of matches of the constraint.- Throws:
AssertionError- when the expected penalty is not observed
-
penalizesByLessThan
As defined bypenalizesByLessThan(int).- Parameters:
message- description of the scenario being assertedmatchWeightTotal- at least 1, expected sum of match weights of matches of the constraint.- Throws:
AssertionError- when the expected penalty is not observed
-
penalizesByLessThan
default void penalizesByLessThan(long matchWeightTotal) As defined bypenalizesByLessThan(int).- Parameters:
matchWeightTotal- at least 1, expected sum of match weights of matches of the constraint.- Throws:
AssertionError- when the expected penalty is not observed
-
penalizesByLessThan
As defined bypenalizesByLessThan(long).- Parameters:
message- description of the scenario being assertedmatchWeightTotal- at least 1, expected sum of match weights of matches of the constraint.- Throws:
AssertionError- when the expected penalty is not observed
-
penalizesByLessThan
As defined bypenalizesByLessThan(long).- Parameters:
matchWeightTotal- at least 1, expected sum of match weights of matches of the constraint.- Throws:
AssertionError- when the expected penalty is not observed
-
penalizesByLessThan
As defined bypenalizesByLessThan(BigDecimal).- Parameters:
message- description of the scenario being assertedmatchWeightTotal- at least 1, expected sum of match weights of matches of the constraint.- Throws:
AssertionError- when the expected penalty is not observed
-
penalizesLessThan
default void penalizesLessThan(long times) Asserts that theConstraintbeing tested, given a set of facts, results in a number of rewards smaller than given.Ignores the constraint and match weights: it only asserts the number of matches. For example: if there are two matches with weight of
10each, this assertion will check for 2 matches.- Parameters:
times- at least 1, expected number of times that the constraint will penalize- Throws:
AssertionError- when the expected penalty is not observed
-
penalizesLessThan
As defined bypenalizesLessThan(long).- Parameters:
message- description of the scenario being assertedtimes- at least 1, expected number of times that the constraint will penalize- Throws:
AssertionError- when the expected penalty is not observed
-
rewardsWithLessThan
default void rewardsWithLessThan(int matchWeightTotal) Asserts that theConstraintbeing tested, given a set of facts, results in a specific reward smaller than given.Ignores the constraint weight: it only asserts the match weights. For example: a match with a match weight of
10on a constraint with a constraint weight of-2hardreduces the score by-20hard. In that case, this assertion checks for10.An
int matchWeightTotalautomatically casts tolongforlong scores.- Parameters:
matchWeightTotal- at least 1, expected sum of match weights of matches of the constraint.- Throws:
AssertionError- when the expected reward is not observed
-
rewardsWithLessThan
As defined byrewardsWithLessThan(int).- Parameters:
message- description of the scenario being assertedmatchWeightTotal- at least 1, expected sum of match weights of matches of the constraint.- Throws:
AssertionError- when the expected reward is not observed
-
rewardsWithLessThan
default void rewardsWithLessThan(long matchWeightTotal) As defined byrewardsWithLessThan(int).- Parameters:
matchWeightTotal- at least 1, expected sum of match weights of matches of the constraint.- Throws:
AssertionError- when the expected reward is not observed
-
rewardsWithLessThan
As defined byrewardsWithLessThan(long).- Parameters:
message- description of the scenario being assertedmatchWeightTotal- at least 1, expected sum of match weights of matches of the constraint.- Throws:
AssertionError- when the expected reward is not observed
-
rewardsWithLessThan
As defined byrewardsWithLessThan(int).- Parameters:
matchWeightTotal- at least 1, expected sum of match weights of matches of the constraint.- Throws:
AssertionError- when the expected reward is not observed
-
rewardsWithLessThan
As defined byrewardsWithLessThan(BigDecimal).- Parameters:
message- description of the scenario being assertedmatchWeightTotal- at least 1, expected sum of match weights of matches of the constraint.- Throws:
AssertionError- when the expected reward is not observed
-
rewardsLessThan
default void rewardsLessThan(long times) Asserts that theConstraintbeing tested, given a set of facts, results in a number of rewards smaller than given.Ignores the constraint and match weights: it only asserts the number of matches For example: if there are two matches with weight of
10each, this assertion will check for 2 matches.- Parameters:
times- at least 1, expected number of times that the constraint will reward- Throws:
AssertionError- when the expected reward is not observed
-
rewardsLessThan
As defined byrewardsLessThan(long).- Parameters:
message- description of the scenario being assertedtimes- at least 1, expected number of times that the constraint will reward- Throws:
AssertionError- when the expected reward is not observed
-
penalizes(String, long)instead.