cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cohei...@apache.org
Subject [1/2] cxf git commit: Switching to use security constants in the tests instead of strings
Date Tue, 28 Mar 2017 15:27:22 GMT
Repository: cxf
Updated Branches:
  refs/heads/master 0ffcd507e -> 428f7700d


http://git-wip-us.apache.org/repos/asf/cxf/blob/428f7700/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/wssc/WSSCUnitTest.java
----------------------------------------------------------------------
diff --git a/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/wssc/WSSCUnitTest.java
b/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/wssc/WSSCUnitTest.java
index 0ee3226..fe6afde 100644
--- a/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/wssc/WSSCUnitTest.java
+++ b/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/wssc/WSSCUnitTest.java
@@ -36,6 +36,7 @@ import javax.xml.ws.Service;
 
 import org.apache.cxf.Bus;
 import org.apache.cxf.bus.spring.SpringBusFactory;
+import org.apache.cxf.rt.security.SecurityConstants;
 import org.apache.cxf.systest.ws.common.SecurityTestUtil;
 import org.apache.cxf.systest.ws.common.TestParam;
 import org.apache.cxf.testutil.common.AbstractBusClientServerTestBase;
@@ -206,11 +207,11 @@ public class WSSCUnitTest extends AbstractBusClientServerTestBase {
         stsClient.setPolicy(createSymmetricBindingPolicy());
 
         Map<String, Object> properties = new HashMap<>();
-        properties.put("security.encryption.username", "bob");
+        properties.put(SecurityConstants.ENCRYPT_USERNAME, "bob");
         TokenCallbackHandler callbackHandler = new TokenCallbackHandler();
-        properties.put("security.callback-handler", callbackHandler);
-        properties.put("security.signature.properties", "alice.properties");
-        properties.put("security.encryption.properties", "bob.properties");
+        properties.put(SecurityConstants.CALLBACK_HANDLER, callbackHandler);
+        properties.put(SecurityConstants.SIGNATURE_PROPERTIES, "alice.properties");
+        properties.put(SecurityConstants.ENCRYPT_PROPERTIES, "bob.properties");
         stsClient.setProperties(properties);
 
         SecurityToken securityToken =
@@ -241,11 +242,11 @@ public class WSSCUnitTest extends AbstractBusClientServerTestBase {
         stsClient.setPolicy(createSymmetricBindingPolicy());
 
         Map<String, Object> properties = new HashMap<>();
-        properties.put("security.encryption.username", "bob");
+        properties.put(SecurityConstants.ENCRYPT_USERNAME, "bob");
         TokenCallbackHandler callbackHandler = new TokenCallbackHandler();
-        properties.put("security.callback-handler", callbackHandler);
-        properties.put("security.signature.properties", "alice.properties");
-        properties.put("security.encryption.properties", "bob.properties");
+        properties.put(SecurityConstants.CALLBACK_HANDLER, callbackHandler);
+        properties.put(SecurityConstants.SIGNATURE_PROPERTIES, "alice.properties");
+        properties.put(SecurityConstants.ENCRYPT_PROPERTIES, "bob.properties");
         stsClient.setProperties(properties);
 
         SecurityToken securityToken =

http://git-wip-us.apache.org/repos/asf/cxf/blob/428f7700/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/x509/DoubleItPropertiesImpl.java
----------------------------------------------------------------------
diff --git a/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/x509/DoubleItPropertiesImpl.java
b/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/x509/DoubleItPropertiesImpl.java
index a729832..23ae971 100644
--- a/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/x509/DoubleItPropertiesImpl.java
+++ b/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/x509/DoubleItPropertiesImpl.java
@@ -23,6 +23,7 @@ import javax.jws.WebService;
 import org.apache.cxf.annotations.EndpointProperties;
 import org.apache.cxf.annotations.EndpointProperty;
 import org.apache.cxf.feature.Features;
+import org.apache.cxf.rt.security.SecurityConstants;
 
 import org.example.contract.doubleit.DoubleItFault;
 import org.example.contract.doubleit.DoubleItPortType;
@@ -33,10 +34,10 @@ import org.example.contract.doubleit.DoubleItPortType;
 @Features(features = "org.apache.cxf.feature.LoggingFeature")
 
 @EndpointProperties({
-    @EndpointProperty(key = "security.encryption.username", value = "alice"),
-    @EndpointProperty(key = "security.encryption.properties", value = "alice.properties"),
-    @EndpointProperty(key = "security.signature.properties", value = "bob.properties"),
-    @EndpointProperty(key = "security.callback-handler",
+    @EndpointProperty(key = SecurityConstants.ENCRYPT_USERNAME, value = "alice"),
+    @EndpointProperty(key = SecurityConstants.ENCRYPT_PROPERTIES, value = "alice.properties"),
+    @EndpointProperty(key = SecurityConstants.SIGNATURE_PROPERTIES, value = "bob.properties"),
+    @EndpointProperty(key = SecurityConstants.CALLBACK_HANDLER,
                       value = "org.apache.cxf.systest.ws.common.KeystorePasswordCallback")
 })
 public class DoubleItPropertiesImpl implements DoubleItPortType {


Mime
View raw message