@Test public void testExecuteWithEntitlementService() throws FMSException { String originalCompression = Config.getProperty(COMPRESSION_REQUEST_FORMAT); try { Config.setProperty(COMPRESSION_REQUEST_FORMAT, CompressorFactory.GZIP_COMPRESS_FORMAT); message.setEntitlementService(true); instance.execute(message); Assert.assertEquals(message.getRequestElements().getRequestParameters().get(RequestElements.REQ_PARAM_RESOURCE_URL), Config.getProperty(Config.BASE_URL_ENTITLEMENTSERVICE) + "/entitlements/v3/fakeRealm?requestid=anyRequestID&minorversion=43&"); Assert.assertEquals(message.getRequestElements().getRequestHeaders().get(RequestElements.HEADER_PARAM_CONTENT_TYPE), "application/xml"); Assert.assertEquals(message.getRequestElements().getRequestHeaders().get(RequestElements.HEADER_PARAM_ACCEPT), "application/xml"); Assert.assertNull(message.getRequestElements().getRequestHeaders().get(Config.COMPRESSION_REQUEST_FORMAT)); Assert.assertEquals(message.getRequestElements().getRequestHeaders().get(RequestElements.HEADER_PARAM_CONTENT_ENCODING), Config.getProperty(Config.COMPRESSION_REQUEST_FORMAT)); } finally { Config.setProperty(COMPRESSION_REQUEST_FORMAT, originalCompression); } }
@Override public void execute(IntuitMessage intuitMessage) throws FMSException { LOG.debug("Enter PrepareRequestInterceptor..."); RequestElements requestElements = intuitMessage.getRequestElements(); Map<String, String> requestParameters = requestElements.getRequestParameters(); String action = (requestElements.getAction() == null) ? getEntityName(requestElements.getEntity()) : requestElements.getAction(); if (intuitMessage.isPlatformService()) { requestParameters.put(RequestElements.REQ_PARAM_RESOURCE_URL, prepareIPSUri(action, requestElements.getContext())); } else if (intuitMessage.isEntitlementService()) { prepareEntitlementsRequest(intuitMessage, requestElements, requestParameters); }else { prepareDataServiceRequest(intuitMessage, requestElements, requestParameters, action); } LOG.debug("Exit PrepareRequestInterceptor."); }
PrepareRequestInterceptor implements Interceptor { @Override public void execute(IntuitMessage intuitMessage) throws FMSException { LOG.debug("Enter PrepareRequestInterceptor..."); RequestElements requestElements = intuitMessage.getRequestElements(); Map<String, String> requestParameters = requestElements.getRequestParameters(); String action = (requestElements.getAction() == null) ? getEntityName(requestElements.getEntity()) : requestElements.getAction(); if (intuitMessage.isPlatformService()) { requestParameters.put(RequestElements.REQ_PARAM_RESOURCE_URL, prepareIPSUri(action, requestElements.getContext())); } else if (intuitMessage.isEntitlementService()) { prepareEntitlementsRequest(intuitMessage, requestElements, requestParameters); }else { prepareDataServiceRequest(intuitMessage, requestElements, requestParameters, action); } LOG.debug("Exit PrepareRequestInterceptor."); } }
PrepareRequestInterceptor implements Interceptor { @Override public void execute(IntuitMessage intuitMessage) throws FMSException { LOG.debug("Enter PrepareRequestInterceptor..."); RequestElements requestElements = intuitMessage.getRequestElements(); Map<String, String> requestParameters = requestElements.getRequestParameters(); String action = (requestElements.getAction() == null) ? getEntityName(requestElements.getEntity()) : requestElements.getAction(); if (intuitMessage.isPlatformService()) { requestParameters.put(RequestElements.REQ_PARAM_RESOURCE_URL, prepareIPSUri(action, requestElements.getContext())); } else if (intuitMessage.isEntitlementService()) { prepareEntitlementsRequest(intuitMessage, requestElements, requestParameters); }else { prepareDataServiceRequest(intuitMessage, requestElements, requestParameters, action); } LOG.debug("Exit PrepareRequestInterceptor."); }  }
PrepareRequestInterceptor implements Interceptor { @Override public void execute(IntuitMessage intuitMessage) throws FMSException { LOG.debug("Enter PrepareRequestInterceptor..."); RequestElements requestElements = intuitMessage.getRequestElements(); Map<String, String> requestParameters = requestElements.getRequestParameters(); String action = (requestElements.getAction() == null) ? getEntityName(requestElements.getEntity()) : requestElements.getAction(); if (intuitMessage.isPlatformService()) { requestParameters.put(RequestElements.REQ_PARAM_RESOURCE_URL, prepareIPSUri(action, requestElements.getContext())); } else if (intuitMessage.isEntitlementService()) { prepareEntitlementsRequest(intuitMessage, requestElements, requestParameters); }else { prepareDataServiceRequest(intuitMessage, requestElements, requestParameters, action); } LOG.debug("Exit PrepareRequestInterceptor."); }  @Override void execute(IntuitMessage intuitMessage); }
PrepareRequestInterceptor implements Interceptor { @Override public void execute(IntuitMessage intuitMessage) throws FMSException { LOG.debug("Enter PrepareRequestInterceptor..."); RequestElements requestElements = intuitMessage.getRequestElements(); Map<String, String> requestParameters = requestElements.getRequestParameters(); String action = (requestElements.getAction() == null) ? getEntityName(requestElements.getEntity()) : requestElements.getAction(); if (intuitMessage.isPlatformService()) { requestParameters.put(RequestElements.REQ_PARAM_RESOURCE_URL, prepareIPSUri(action, requestElements.getContext())); } else if (intuitMessage.isEntitlementService()) { prepareEntitlementsRequest(intuitMessage, requestElements, requestParameters); }else { prepareDataServiceRequest(intuitMessage, requestElements, requestParameters, action); } LOG.debug("Exit PrepareRequestInterceptor."); }  @Override void execute(IntuitMessage intuitMessage);  }