CONNECTOrchestrationBase implements CONNECTOrchestrator { protected boolean isPolicyOk(Orchestratable message, PolicyTransformer.Direction direction) { LOG.debug("Entering CONNECTNhinOrchestrator.isPolicyOk(...)"); boolean policyIsValid = false; try { PolicyEngineProxyObjectFactory policyEngFactory = new PolicyEngineProxyObjectFactory(); PolicyEngineProxy policyProxy = policyEngFactory.getPolicyEngineProxy(); PolicyTransformer transformer = message.getPolicyTransformer(); CheckPolicyRequestType policyReq = transformer.transform(message, direction); if (policyReq != null && message.getAssertion() != null) { CheckPolicyResponseType policyResp = policyProxy.checkPolicy(policyReq, message.getAssertion()); if (policyResp.getResponse() != null && policyResp.getResponse().getResult() != null) { for (ResultType r : policyResp.getResponse().getResult()) { if (r.getDecision() == DecisionType.PERMIT) { policyIsValid = true; } break; } } } } catch (Exception exc) { LOG.error("Error: Failed to check policy.", exc); } LOG.debug("Exiting CONNECTNhinOrchestrator.isPolicyOk(...) with a value of :" + policyIsValid); return policyIsValid; } CONNECTOrchestrationBase();  CONNECTOrchestrationBase(IPropertyAcessor propertyAccessor); @Override Orchestratable process(Orchestratable message); Orchestratable processNotNullMessage(Orchestratable message); Orchestratable processEnabledMessage(Orchestratable message); Orchestratable processPassThruMessage(Orchestratable message); Orchestratable processInboundIfPolicyIsOk(Orchestratable message); Orchestratable processOutboundIfPolicyIsOk(Orchestratable message);  }
@Test public void testIsPolicyOk() { Orchestratable message = null; Direction direction = null; CONNECTOrchestrationBase instance = new DenyCONNECTOrchestrationBaseImpl(); boolean expResult = false; boolean result = instance.isPolicyOk(message, direction); assertEquals(expResult, result); }