Interface SingleConstraintAssertion
- 
- All Known Implementing Classes:
- DefaultSingleConstraintAssertion
 
 public interface SingleConstraintAssertion
- 
- 
Method SummaryAll Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default voidpenalizes()Asserts 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.voidpenalizes(long times, String message)As defined bypenalizes(long).voidpenalizes(String message)As defined bypenalizes().default voidpenalizesBy(int matchWeightTotal)Asserts that theConstraintbeing tested, given a set of facts, results in a specific penalty.voidpenalizesBy(int matchWeightTotal, String message)As defined bypenalizesBy(int).default voidpenalizesBy(long matchWeightTotal)As defined bypenalizesBy(int).voidpenalizesBy(long matchWeightTotal, String message)As defined bypenalizesBy(int).default voidpenalizesBy(BigDecimal matchWeightTotal)As defined bypenalizesBy(int).voidpenalizesBy(BigDecimal matchWeightTotal, String message)As defined bypenalizesBy(int).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.voidrewards(long times, String message)As defined byrewards(long).voidrewards(String message)As defined byrewards().default voidrewardsWith(int matchWeightTotal)Asserts that theConstraintbeing tested, given a set of facts, results in a specific reward.voidrewardsWith(int matchWeightTotal, String message)As defined byrewardsWith(int).default voidrewardsWith(long matchWeightTotal)As defined byrewardsWith(int).voidrewardsWith(long matchWeightTotal, String message)As defined byrewardsWith(int).default voidrewardsWith(BigDecimal matchWeightTotal)As defined byrewardsWith(int).voidrewardsWith(BigDecimal matchWeightTotal, String message)As defined byrewardsWith(int).
 
- 
- 
- 
Method Detail- 
penalizesBydefault 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
 
 - 
penalizesByvoid penalizesBy(int matchWeightTotal, String message)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
 
 - 
penalizesBydefault 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
 
 - 
penalizesByvoid penalizesBy(long matchWeightTotal, String message)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
 
 - 
penalizesBydefault void penalizesBy(BigDecimal 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
 
 - 
penalizesByvoid penalizesBy(BigDecimal matchWeightTotal, String message) 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
 
 - 
penalizesdefault 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
 
 - 
penalizesvoid penalizes(long times, String message)As defined bypenalizes(long).- Parameters:
- times- at least 0, expected number of times that the constraint will penalize
- message- sometimes null, description of the scenario being asserted
- Throws:
- AssertionError- when the expected penalty is not observed
 
 - 
penalizesdefault 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
 
 - 
penalizesvoid penalizes(String message) As defined bypenalizes().- Parameters:
- message- sometimes null, description of the scenario being asserted
- Throws:
- AssertionError- when there are no penalties
 
 - 
rewardsWithdefault 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
 
 - 
rewardsWithvoid rewardsWith(int matchWeightTotal, String message)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
 
 - 
rewardsWithdefault 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
 
 - 
rewardsWithvoid rewardsWith(long matchWeightTotal, String message)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
 
 - 
rewardsWithdefault void rewardsWith(BigDecimal 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
 
 - 
rewardsWithvoid rewardsWith(BigDecimal matchWeightTotal, String message) 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
 
 - 
rewardsdefault 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
 
 - 
rewardsvoid rewards(long times, String message)As defined byrewards(long).- Parameters:
- times- at least 0, expected number of times that the constraint will reward
- message- sometimes null, description of the scenario being asserted
- Throws:
- AssertionError- when the expected reward is not observed
 
 - 
rewardsdefault 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
 
 - 
rewardsvoid rewards(String message) As defined byrewards().- Parameters:
- message- sometimes null, description of the scenario being asserted
- Throws:
- AssertionError- when there are no rewards
 
 
- 
 
-