Test failure: testGetUserByRef LdapProviderTest
Added null check in test teardown after failed assumption in test setup
package org.apache.jackrabbit.oak.security.authentication.ldap;
+import static junit.framework.Assert.assertEquals;
+import static junit.framework.Assert.assertNotNull;
+import static junit.framework.Assert.assertNull;
+import static junit.framework.Assert.assertTrue;
+import static junit.framework.Assert.fail;
+import static org.junit.Assert.assertArrayEquals;
+import static org.junit.Assert.assertThat;
+
import java.io.InputStream;
import java.util.Arrays;
import java.util.Collection;
@@ -46,15 +54,6 @@ import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
-import static junit.framework.Assert.assertEquals;
-import static junit.framework.Assert.assertNotNull;
-import static junit.framework.Assert.assertNull;
-import static junit.framework.Assert.assertTrue;
-import static junit.framework.Assert.fail;
-
-import static org.junit.Assert.assertArrayEquals;
-import static org.junit.Assert.assertThat;
-
public class LdapProviderTest {
protected static final InternalLdapServer LDAP_SERVER = new InternalLdapServer();
@@ -101,9 +100,11 @@ public class LdapProviderTest {
if (!USE_COMMON_LDAP_FIXTURE) {
LDAP_SERVER.tearDown();
}
+ if (idp != null) {
idp.close();
idp = null;
}
+ }
protected LdapIdentityProvider createIDP() {
//The attribute "mail" is excluded deliberately
