Repository: tomee Updated Branches: refs/heads/master e493c51ab -> 1e2a12520
reformatting + fixing exception string message (we can surely do better here) Project: http://git-wip-us.apache.org/repos/asf/tomee/repo Commit: http://git-wip-us.apache.org/repos/asf/tomee/commit/1e2a1252 Tree: http://git-wip-us.apache.org/repos/asf/tomee/tree/1e2a1252 Diff: http://git-wip-us.apache.org/repos/asf/tomee/diff/1e2a1252 Branch: refs/heads/master Commit: 1e2a125203e3382433f3a68b45ed5789ca84be29 Parents: e493c51 Author: Romain Manni-Bucau <[email protected]> Authored: Thu Apr 23 12:30:44 2015 +0200 Committer: Romain Manni-Bucau <[email protected]> Committed: Thu Apr 23 12:30:44 2015 +0200 ---------------------------------------------------------------------- .../superbiz/ws/security/CalculatorTest.java | 60 ++++++++++---------- 1 file changed, 30 insertions(+), 30 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/tomee/blob/1e2a1252/examples/webservice-ws-with-resources-config/src/test/java/org/superbiz/ws/security/CalculatorTest.java ---------------------------------------------------------------------- diff --git a/examples/webservice-ws-with-resources-config/src/test/java/org/superbiz/ws/security/CalculatorTest.java b/examples/webservice-ws-with-resources-config/src/test/java/org/superbiz/ws/security/CalculatorTest.java index 78ecf0e..f0dda24 100644 --- a/examples/webservice-ws-with-resources-config/src/test/java/org/superbiz/ws/security/CalculatorTest.java +++ b/examples/webservice-ws-with-resources-config/src/test/java/org/superbiz/ws/security/CalculatorTest.java @@ -5,9 +5,9 @@ * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * + * <p/> + * http://www.apache.org/licenses/LICENSE-2.0 + * <p/> * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -54,23 +54,23 @@ public class CalculatorTest { // normal call final Service service = Service.create( - new URL("http://127.0.0.1:" + port + "/webservice-ws-with-resources-config/CalculatorBean?wsdl"), - new QName("http://security.ws.superbiz.org/", "CalculatorBeanService")); + new URL("http://127.0.0.1:" + port + "/webservice-ws-with-resources-config/CalculatorBean?wsdl"), + new QName("http://security.ws.superbiz.org/", "CalculatorBeanService")); final Calculator calculator = service.getPort(Calculator.class); ClientProxy.getClient(calculator).getOutInterceptors().add( - new WSS4JOutInterceptor(new HashMap<String, Object>() {{ - put("action", "UsernameToken"); - put("user", "openejb"); - put("passwordType", "PasswordText"); - put("passwordCallbackRef", new CallbackHandler() { - @Override - public void handle(Callback[] callbacks) throws IOException, UnsupportedCallbackException { - final WSPasswordCallback pc = (WSPasswordCallback) callbacks[0]; - pc.setPassword("tomee"); - } - }); - }})); + new WSS4JOutInterceptor(new HashMap<String, Object>() {{ + put("action", "UsernameToken"); + put("user", "openejb"); + put("passwordType", "PasswordText"); + put("passwordCallbackRef", new CallbackHandler() { + @Override + public void handle(Callback[] callbacks) throws IOException, UnsupportedCallbackException { + final WSPasswordCallback pc = (WSPasswordCallback) callbacks[0]; + pc.setPassword("tomee"); + } + }); + }})); assertEquals(5, calculator.add(2, 3)); @@ -78,23 +78,23 @@ public class CalculatorTest { final Calculator calculator2 = service.getPort(Calculator.class); ClientProxy.getClient(calculator2).getOutInterceptors().add( - new WSS4JOutInterceptor(new HashMap<String, Object>() {{ - put("action", "UsernameToken"); - put("user", "openejb"); - put("passwordType", "PasswordText"); - put("passwordCallbackRef", new CallbackHandler() { - @Override - public void handle(Callback[] callbacks) throws IOException, UnsupportedCallbackException { - final WSPasswordCallback pc = (WSPasswordCallback) callbacks[0]; - pc.setPassword("wrong"); - } - }); - }})); + new WSS4JOutInterceptor(new HashMap<String, Object>() {{ + put("action", "UsernameToken"); + put("user", "openejb"); + put("passwordType", "PasswordText"); + put("passwordCallbackRef", new CallbackHandler() { + @Override + public void handle(Callback[] callbacks) throws IOException, UnsupportedCallbackException { + final WSPasswordCallback pc = (WSPasswordCallback) callbacks[0]; + pc.setPassword("wrong"); + } + }); + }})); try { assertEquals(5, calculator2.add(2, 3)); } catch (SOAPFaultException sfe) { - assertThat(sfe.getMessage(), CoreMatchers.containsString("The security token could not be authenticated or authorized")); + assertThat(sfe.getMessage(), CoreMatchers.containsString("A security error was encountered when verifying the message")); } container.close();
