Author: angela
Date: Tue Feb 28 14:33:20 2017
New Revision: 1784744
URL: http://svn.apache.org/viewvc?rev=1784744&view=rev
Log:
OAK-5793 : Improve coverage for security code in oak-core (wip)
Modified:
jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/spi/security/authentication/credentials/SimpleCredentialsSupportTest.java
Modified:
jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/spi/security/authentication/credentials/SimpleCredentialsSupportTest.java
URL:
http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/spi/security/authentication/credentials/SimpleCredentialsSupportTest.java?rev=1784744&r1=1784743&r2=1784744&view=diff
==============================================================================
---
jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/spi/security/authentication/credentials/SimpleCredentialsSupportTest.java
(original)
+++
jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/spi/security/authentication/credentials/SimpleCredentialsSupportTest.java
Tue Feb 28 14:33:20 2017
@@ -25,6 +25,7 @@ import com.google.common.collect.Immutab
import org.junit.Test;
import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;
@@ -93,24 +94,8 @@ public class SimpleCredentialsSupportTes
}
@Test
- public void testSetAttributes() {
- Map<String, ?> attributes = credentialsSupport.getAttributes(new
TestCredentials());
- assertNotNull(attributes);
- assertTrue(attributes.isEmpty());
-
- SimpleCredentials sc = new SimpleCredentials("uid", new char[0]);
-
- Map<String, ?> expected = ImmutableMap.of("a", "a", "b", Boolean.TRUE,
"c", new TestCredentials());
- credentialsSupport.setAttributes(sc, expected);
-
- for (Map.Entry<String, ?> entry : expected.entrySet()) {
- assertEquals(entry.getValue(), sc.getAttribute(entry.getKey()));
- }
-
- attributes = credentialsSupport.getAttributes(sc);
- assertNotNull(attributes);
- assertEquals(3, attributes.size());
- assertEquals(expected, attributes);
+ public void testSetAttributesFalse() {
+ assertFalse(credentialsSupport.setAttributes(new Credentials() {},
ImmutableMap.of("a", "value")));
}
private static final class TestCredentials implements Credentials {}