SEC-2173: Added SystemWideSaltSource.toString() test

This commit is contained in:
Rob Winch 2014-03-14 08:54:36 -05:00
parent 1c50a86661
commit 2628be60d1
1 changed files with 10 additions and 0 deletions

View File

@ -15,6 +15,8 @@
package org.springframework.security.authentication.dao.salt;
import static org.fest.assertions.Assertions.assertThat;
import org.springframework.security.authentication.dao.SystemWideSaltSource;
import junit.framework.TestCase;
@ -69,4 +71,12 @@ public class SystemWideSaltSourceTests extends TestCase {
saltSource.afterPropertiesSet();
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);
}
}