From 186bb2462b0979b341beab2dd1c6d0708d52893a Mon Sep 17 00:00:00 2001 From: Greg Turnquist Date: Mon, 30 Oct 2017 11:12:19 -0500 Subject: [PATCH] SWS-955 - Polishing --- .../security/wss4j2/Wss4jSecurityInterceptor.java | 3 +-- .../wss4j2/Wss4jMessageInterceptorSamlTestCase.java | 13 +++++-------- 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/spring-ws-security/src/main/java/org/springframework/ws/soap/security/wss4j2/Wss4jSecurityInterceptor.java b/spring-ws-security/src/main/java/org/springframework/ws/soap/security/wss4j2/Wss4jSecurityInterceptor.java index 5edb143d..01dad04d 100644 --- a/spring-ws-security/src/main/java/org/springframework/ws/soap/security/wss4j2/Wss4jSecurityInterceptor.java +++ b/spring-ws-security/src/main/java/org/springframework/ws/soap/security/wss4j2/Wss4jSecurityInterceptor.java @@ -640,8 +640,7 @@ public class Wss4jSecurityInterceptor extends AbstractWsSecurityInterceptor impl requestData.setAllowRSA15KeyTransportAlgorithm(allowRSA15KeyTransportAlgorithm); requestData.setDisableBSPEnforcement(!bspCompliant); - if (requestData.getBSPEnforcer() != null) - { + if (requestData.getBSPEnforcer() != null) { requestData.getBSPEnforcer().setDisableBSPRules(!bspCompliant); } // allow for qualified password types for .Net interoperability diff --git a/spring-ws-security/src/test/java/org/springframework/ws/soap/security/wss4j2/Wss4jMessageInterceptorSamlTestCase.java b/spring-ws-security/src/test/java/org/springframework/ws/soap/security/wss4j2/Wss4jMessageInterceptorSamlTestCase.java index 419e02f7..377f7f55 100644 --- a/spring-ws-security/src/test/java/org/springframework/ws/soap/security/wss4j2/Wss4jMessageInterceptorSamlTestCase.java +++ b/spring-ws-security/src/test/java/org/springframework/ws/soap/security/wss4j2/Wss4jMessageInterceptorSamlTestCase.java @@ -2,7 +2,6 @@ package org.springframework.ws.soap.security.wss4j2; import java.io.IOException; import java.security.cert.X509Certificate; - import javax.security.auth.callback.Callback; import javax.security.auth.callback.CallbackHandler; import javax.security.auth.callback.UnsupportedCallbackException; @@ -16,11 +15,12 @@ import org.apache.wss4j.common.saml.bean.SubjectBean; import org.apache.wss4j.common.saml.bean.Version; import org.apache.wss4j.common.saml.builder.SAML2Constants; import org.junit.Test; +import org.w3c.dom.Document; + import org.springframework.core.io.ClassPathResource; import org.springframework.ws.context.MessageContext; import org.springframework.ws.soap.SoapMessage; import org.springframework.ws.soap.security.wss4j2.support.CryptoFactoryBean; -import org.w3c.dom.Document; public abstract class Wss4jMessageInterceptorSamlTestCase extends Wss4jTestCase { @@ -51,8 +51,7 @@ public abstract class Wss4jMessageInterceptorSamlTestCase extends Wss4jTestCase } @Test - public void testAddSAML() throws Exception - { + public void testAddSAML() throws Exception { interceptor.setSecurementPassword("123456"); interceptor.setSecurementUsername("rsaKey"); SoapMessage message = loadSoap11Message("empty-soap.xml"); @@ -68,8 +67,7 @@ public abstract class Wss4jMessageInterceptorSamlTestCase extends Wss4jTestCase interceptor.validateMessage(message, messageContext); } - protected CallbackHandler getSamlCalbackHandler(Crypto crypto, X509Certificate userCert) - { + protected CallbackHandler getSamlCalbackHandler(Crypto crypto, X509Certificate userCert) { return new SamlCallbackHandler(crypto, userCert); } @@ -79,8 +77,7 @@ public abstract class Wss4jMessageInterceptorSamlTestCase extends Wss4jTestCase private X509Certificate userCertificate; - public SamlCallbackHandler(Crypto crypto, X509Certificate userCertificate) - { + public SamlCallbackHandler(Crypto crypto, X509Certificate userCertificate) { this.crypto = crypto; this.userCertificate = userCertificate; }