@Test public void testNoDescriptionNoTargetType() throws IOException { PolicyRestAdapter adapter = new PolicyRestAdapter(); adapter.setPolicyData(new PolicyType()); adapter.setPolicyName("name"); ActionPolicyController controller = new ActionPolicyController(); assertThatCode(() -> controller.prePopulateActionPolicyData(adapter)).doesNotThrowAnyException(); }
public void prePopulateActionPolicyData(PolicyRestAdapter policyAdapter) { ruleAlgorithmList = new ArrayList<>(); performer.put("PDP", "PDPAction"); performer.put("PEP", "PEPAction"); if (! (policyAdapter.getPolicyData() instanceof PolicyType)) { return; } PolicyType policy = (PolicyType) policyAdapter.getPolicyData(); setPolicyAdapterPolicyNameAndDesc(policyAdapter, policy); TargetType target = policy.getTarget(); if (target == null) { return; } setPolicyAdapterAttributes(policyAdapter, target.getAnyOf()); List<Object> ruleList = policy.getCombinerParametersOrRuleCombinerParametersOrVariableDefinition(); for (Object o : ruleList) { if (!(o instanceof RuleType)) { continue; } setPolicyAdapterRuleAlgorithmschoices(policyAdapter, (RuleType) o); ObligationExpressionsType obligations = ((RuleType) o).getObligationExpressions(); setPolicyAdapterActionData(policyAdapter, obligations); } }
ActionPolicyController extends RestrictedBaseController { public void prePopulateActionPolicyData(PolicyRestAdapter policyAdapter) { ruleAlgorithmList = new ArrayList<>(); performer.put("PDP", "PDPAction"); performer.put("PEP", "PEPAction"); if (! (policyAdapter.getPolicyData() instanceof PolicyType)) { return; } PolicyType policy = (PolicyType) policyAdapter.getPolicyData(); setPolicyAdapterPolicyNameAndDesc(policyAdapter, policy); TargetType target = policy.getTarget(); if (target == null) { return; } setPolicyAdapterAttributes(policyAdapter, target.getAnyOf()); List<Object> ruleList = policy.getCombinerParametersOrRuleCombinerParametersOrVariableDefinition(); for (Object o : ruleList) { if (!(o instanceof RuleType)) { continue; } setPolicyAdapterRuleAlgorithmschoices(policyAdapter, (RuleType) o); ObligationExpressionsType obligations = ((RuleType) o).getObligationExpressions(); setPolicyAdapterActionData(policyAdapter, obligations); } } }
ActionPolicyController extends RestrictedBaseController { public void prePopulateActionPolicyData(PolicyRestAdapter policyAdapter) { ruleAlgorithmList = new ArrayList<>(); performer.put("PDP", "PDPAction"); performer.put("PEP", "PEPAction"); if (! (policyAdapter.getPolicyData() instanceof PolicyType)) { return; } PolicyType policy = (PolicyType) policyAdapter.getPolicyData(); setPolicyAdapterPolicyNameAndDesc(policyAdapter, policy); TargetType target = policy.getTarget(); if (target == null) { return; } setPolicyAdapterAttributes(policyAdapter, target.getAnyOf()); List<Object> ruleList = policy.getCombinerParametersOrRuleCombinerParametersOrVariableDefinition(); for (Object o : ruleList) { if (!(o instanceof RuleType)) { continue; } setPolicyAdapterRuleAlgorithmschoices(policyAdapter, (RuleType) o); ObligationExpressionsType obligations = ((RuleType) o).getObligationExpressions(); setPolicyAdapterActionData(policyAdapter, obligations); } } ActionPolicyController(); }
ActionPolicyController extends RestrictedBaseController { public void prePopulateActionPolicyData(PolicyRestAdapter policyAdapter) { ruleAlgorithmList = new ArrayList<>(); performer.put("PDP", "PDPAction"); performer.put("PEP", "PEPAction"); if (! (policyAdapter.getPolicyData() instanceof PolicyType)) { return; } PolicyType policy = (PolicyType) policyAdapter.getPolicyData(); setPolicyAdapterPolicyNameAndDesc(policyAdapter, policy); TargetType target = policy.getTarget(); if (target == null) { return; } setPolicyAdapterAttributes(policyAdapter, target.getAnyOf()); List<Object> ruleList = policy.getCombinerParametersOrRuleCombinerParametersOrVariableDefinition(); for (Object o : ruleList) { if (!(o instanceof RuleType)) { continue; } setPolicyAdapterRuleAlgorithmschoices(policyAdapter, (RuleType) o); ObligationExpressionsType obligations = ((RuleType) o).getObligationExpressions(); setPolicyAdapterActionData(policyAdapter, obligations); } } ActionPolicyController(); void prePopulateActionPolicyData(PolicyRestAdapter policyAdapter); }
ActionPolicyController extends RestrictedBaseController { public void prePopulateActionPolicyData(PolicyRestAdapter policyAdapter) { ruleAlgorithmList = new ArrayList<>(); performer.put("PDP", "PDPAction"); performer.put("PEP", "PEPAction"); if (! (policyAdapter.getPolicyData() instanceof PolicyType)) { return; } PolicyType policy = (PolicyType) policyAdapter.getPolicyData(); setPolicyAdapterPolicyNameAndDesc(policyAdapter, policy); TargetType target = policy.getTarget(); if (target == null) { return; } setPolicyAdapterAttributes(policyAdapter, target.getAnyOf()); List<Object> ruleList = policy.getCombinerParametersOrRuleCombinerParametersOrVariableDefinition(); for (Object o : ruleList) { if (!(o instanceof RuleType)) { continue; } setPolicyAdapterRuleAlgorithmschoices(policyAdapter, (RuleType) o); ObligationExpressionsType obligations = ((RuleType) o).getObligationExpressions(); setPolicyAdapterActionData(policyAdapter, obligations); } } ActionPolicyController(); void prePopulateActionPolicyData(PolicyRestAdapter policyAdapter);  }