diff --git a/core/src/main/java/org/springframework/ws/soap/axiom/AxiomSoapMessageFactory.java b/core/src/main/java/org/springframework/ws/soap/axiom/AxiomSoapMessageFactory.java index a8c5ac0d..270568e7 100644 --- a/core/src/main/java/org/springframework/ws/soap/axiom/AxiomSoapMessageFactory.java +++ b/core/src/main/java/org/springframework/ws/soap/axiom/AxiomSoapMessageFactory.java @@ -1,11 +1,11 @@ /* - * Copyright 2005-2010 the original author or authors. + * Copyright 2005-2012 the original author or authors. * * Licensed 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 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -232,7 +232,7 @@ public class AxiomSoapMessageFactory implements SoapMessageFactory, Initializing private boolean isMultiPartRelated(String contentType) { contentType = contentType.toLowerCase(Locale.ENGLISH); - return contentType.indexOf(MULTI_PART_RELATED_CONTENT_TYPE) != -1; + return contentType.contains(MULTI_PART_RELATED_CONTENT_TYPE); } /** Creates an AxiomSoapMessage without attachments. */ @@ -272,10 +272,10 @@ public class AxiomSoapMessageFactory implements SoapMessageFactory, Initializing } private String getSoapEnvelopeNamespace(String contentType) { - if (contentType.indexOf(SOAP11Constants.SOAP_11_CONTENT_TYPE) != -1) { + if (contentType.contains(SOAP11Constants.SOAP_11_CONTENT_TYPE)) { return SOAP11Constants.SOAP_ENVELOPE_NAMESPACE_URI; } - else if (contentType.indexOf(SOAP12Constants.SOAP_12_CONTENT_TYPE) != -1) { + else if (contentType.contains(SOAP12Constants.SOAP_12_CONTENT_TYPE)) { return SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI; } else { diff --git a/core/src/test/java/org/springframework/ws/server/MessageDispatcherTest.java b/core/src/test/java/org/springframework/ws/server/MessageDispatcherTest.java index bb1080ff..087e3cef 100644 --- a/core/src/test/java/org/springframework/ws/server/MessageDispatcherTest.java +++ b/core/src/test/java/org/springframework/ws/server/MessageDispatcherTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2005-2011 the original author or authors. + * Copyright 2005-2012 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -81,7 +81,7 @@ public class MessageDispatcherTest { verify(adapterMock, factoryMock); - Assert.assertEquals("getEnpointAdapter returns invalid EndpointAdapter", adapterMock, result); + Assert.assertEquals("getEndpointAdapter returns invalid EndpointAdapter", adapterMock, result); } @Test diff --git a/core/src/test/java/org/springframework/ws/soap/soap11/AbstractSoap11MessageFactoryTestCase.java b/core/src/test/java/org/springframework/ws/soap/soap11/AbstractSoap11MessageFactoryTestCase.java index e51795cd..dd8e0679 100644 --- a/core/src/test/java/org/springframework/ws/soap/soap11/AbstractSoap11MessageFactoryTestCase.java +++ b/core/src/test/java/org/springframework/ws/soap/soap11/AbstractSoap11MessageFactoryTestCase.java @@ -67,8 +67,7 @@ public abstract class AbstractSoap11MessageFactoryTestCase extends AbstractSoapM headers.put("Content-Type", "text/xml"); TransportInputStream tis = new MockTransportInputStream(is, headers); - WebServiceMessage message = messageFactory.createWebServiceMessage(tis); - message.writeTo(System.out); + messageFactory.createWebServiceMessage(tis); } @Override