Policy extends PolicyDef { @Override public EvaluationResult evaluate(EvaluationContext evaluationContext) throws EvaluationException { if (!this.validate()) { return new EvaluationResult(new StdStatus(this.getStatusCode(), this.getStatusMessage())); } MatchResult thisMatchResult = this.match(evaluationContext); assert thisMatchResult != null; if (evaluationContext.isTracing()) { evaluationContext.trace(new StdTraceEvent<MatchResult>("Match", this, thisMatchResult)); } switch (thisMatchResult.getMatchCode()) { case INDETERMINATE: return new EvaluationResult(Decision.INDETERMINATE, thisMatchResult.getStatus()); case MATCH: break; case NOMATCH: return new EvaluationResult(Decision.NOTAPPLICABLE); } List<CombiningElement<Rule>> ruleCombiningElements = this.getCombiningRules(); assert ruleCombiningElements != null; assert this.getRuleCombiningAlgorithm() != null; EvaluationResult evaluationResultCombined = this.getRuleCombiningAlgorithm() .combine(evaluationContext, ruleCombiningElements, this.getCombinerParameterList()); assert evaluationResultCombined != null; if (evaluationContext.getRequest().getReturnPolicyIdList()) { evaluationResultCombined.addPolicyIdentifier(this.getIdReference()); } if (evaluationResultCombined.getDecision() == Decision.DENY || evaluationResultCombined.getDecision() == Decision.PERMIT) { this.updateResult(evaluationResultCombined, evaluationContext); } if (evaluationContext.isTracing()) { evaluationContext.trace(new StdTraceEvent<Result>("Result", this, evaluationResultCombined)); } return evaluationResultCombined; } Policy(PolicySet policySetParent, StatusCode statusCodeIn, String statusMessageIn);  Policy(StatusCode statusCodeIn, String statusMessageIn);  Policy(StatusCode statusCodeIn);  Policy(PolicySet policySetParent);  Policy(); Iterator<TargetedCombinerParameter<String, Rule>> getRuleCombinerParameters(); void setRuleCombinerParameters(Collection<TargetedCombinerParameter<String, Rule>> ruleCombinerParameters); void addRuleCombinerParameter(TargetedCombinerParameter<String, Rule> ruleCombinerParameter); void addRuleCombinerParameters(Collection<TargetedCombinerParameter<String, Rule>> ruleCombinerParameters); Iterator<VariableDefinition> getVariableDefinitions(); VariableDefinition getVariableDefinition(String variableId); void setVariableDefinitions(Collection<VariableDefinition> listVariableDefinitions); void addVariableDefinition(VariableDefinition variableDefinition); void addVariableDefinitions(Collection<VariableDefinition> variableDefinitions); Iterator<Rule> getRules(); void setRules(Collection<Rule> listRules); void addRule(Rule rule); void addRules(Collection<Rule> listRules); CombiningAlgorithm<Rule> getRuleCombiningAlgorithm(); void setRuleCombiningAlgorithm(CombiningAlgorithm<Rule> ruleCombiningAlgorithmIn); @Override EvaluationResult evaluate(EvaluationContext evaluationContext); @Override String toString();  }
@Test public void testIncludePolicyIdentifierForIndeterminate() throws EvaluationException { PolicyDef policy = createPolicy(); EvaluationResult evaluationResult = policy.evaluate(evaluationContext); Collection<IdReference> policyIdentifiers = getPolicyIdentifiers(evaluationResult); assertEquals(1, policyIdentifiers.size()); assertEquals(Decision.INDETERMINATE, evaluationResult.getDecision()); }