SoapActionSmartEndpointInterceptor extends DelegatingSmartSoapEndpointInterceptor { @Override protected boolean shouldIntercept(WebServiceMessage request, Object endpoint) { if (request instanceof SoapMessage) { String soapAction = ((SoapMessage) request).getSoapAction(); if (StringUtils.hasLength(soapAction) && soapAction.charAt(0) == '"' && soapAction.charAt(soapAction.length() - 1) == '"') { soapAction = soapAction.substring(1, soapAction.length() - 1); } return this.soapAction.equals(soapAction); } else { return false; } } SoapActionSmartEndpointInterceptor(EndpointInterceptor delegate, String soapAction);   }
@Test public void shouldInterceptMatch() throws Exception { SoapActionSmartEndpointInterceptor interceptor = new SoapActionSmartEndpointInterceptor(delegate, soapAction); boolean result = interceptor.shouldIntercept(messageContext, null); assertTrue("Interceptor should apply", result); }
@Test public void shouldInterceptNonMatch() throws Exception { SoapActionSmartEndpointInterceptor interceptor = new SoapActionSmartEndpointInterceptor(delegate, "http: boolean result = interceptor.shouldIntercept(messageContext, null); assertFalse("Interceptor should apply", result); }