浏览代码

SEC-2173: Added SystemWideSaltSource.toString() test

Rob Winch 11 年之前
父节点
当前提交
2628be60d1

+ 10 - 0
core/src/test/java/org/springframework/security/authentication/dao/salt/SystemWideSaltSourceTests.java

@@ -15,6 +15,8 @@
 
 
 package org.springframework.security.authentication.dao.salt;
 package org.springframework.security.authentication.dao.salt;
 
 
+import static org.fest.assertions.Assertions.assertThat;
+
 import org.springframework.security.authentication.dao.SystemWideSaltSource;
 import org.springframework.security.authentication.dao.SystemWideSaltSource;
 
 
 import junit.framework.TestCase;
 import junit.framework.TestCase;
@@ -69,4 +71,12 @@ public class SystemWideSaltSourceTests extends TestCase {
         saltSource.afterPropertiesSet();
         saltSource.afterPropertiesSet();
         assertEquals("helloWorld", saltSource.getSalt(null));
         assertEquals("helloWorld", saltSource.getSalt(null));
     }
     }
+
+    // SEC-2173
+    public void testToString() {
+        String systemWideSalt = "helloWorld";
+        SystemWideSaltSource saltSource = new SystemWideSaltSource();
+        saltSource.setSystemWideSalt(systemWideSalt);
+        assertThat(saltSource.toString()).isEqualTo(systemWideSalt);
+    }
 }
 }