[java-identity-provider] branch main updated: IDP-1676 Add test for LDAP failfast
Rod Widdowson
rdw at steadingsoftware.com
Thu Dec 10 15:43:33 UTC 2020
This is an automated email from the git hooks/post-receive script.
rdw pushed a commit to branch main
in repository java-identity-provider.
View the commit online:
http://git.shibboleth.net/view/?p=java-identity-provider.git;a=commit;h=e8c87a900879cfa38437641cec850442b6cc86ac
The following commit(s) were added to refs/heads/main by this push:
new e8c87a900 IDP-1676 Add test for LDAP failfast
e8c87a900 is described below
commit e8c87a900879cfa38437641cec850442b6cc86ac
Author: Rod Widdowson <rdw at steadingsoftware.com>
AuthorDate: Tue Dec 8 10:21:08 2020 +0000
IDP-1676 Add test for LDAP failfast
---
.../resolver/spring/AttributeResolverTest.java | 25 ++++++++++++++++++++--
.../resolver/spring/attribute-resolver.xml | 3 ++-
2 files changed, 25 insertions(+), 3 deletions(-)
diff --git a/idp-attribute-resolver-spring/src/test/java/net/shibboleth/idp/attribute/resolver/spring/AttributeResolverTest.java b/idp-attribute-resolver-spring/src/test/java/net/shibboleth/idp/attribute/resolver/spring/AttributeResolverTest.java
index 64eda0d68..f3fba33c8 100644
--- a/idp-attribute-resolver-spring/src/test/java/net/shibboleth/idp/attribute/resolver/spring/AttributeResolverTest.java
+++ b/idp-attribute-resolver-spring/src/test/java/net/shibboleth/idp/attribute/resolver/spring/AttributeResolverTest.java
@@ -20,6 +20,7 @@ package net.shibboleth.idp.attribute.resolver.spring;
import static org.testng.Assert.assertEquals;
import static org.testng.Assert.assertNotNull;
import static org.testng.Assert.assertTrue;
+import static org.testng.Assert.fail;
import java.util.Arrays;
import java.util.HashSet;
@@ -158,11 +159,31 @@ public class AttributeResolverTest extends OpenSAMLInitBaseTestCase {
}
@Test public void service() throws ComponentInitializationException, ServiceException, ResolutionException {
- helper(true);
+ helper(false);
}
@Test public void serviceNullStrip() throws ComponentInitializationException, ServiceException, ResolutionException {
- helper(false);
+ helper(true);
+ }
+
+ @Test public void serviceLDAPRecover() throws ComponentInitializationException, ServiceException, ResolutionException, LDAPException {
+ teardownDataConnectors();
+ boolean dataConnectorOff = true;
+ try {
+ try {
+ helper(false);
+ fail("Expected to throw an exception");
+ } catch (final ResolutionException e) {
+ log.debug("The expected exception");
+ }
+ setupDataConnectors();
+ dataConnectorOff = false;
+ helper(true);
+ } finally {
+ if (dataConnectorOff) {
+ setupDataConnectors();
+ }
+ }
}
/**
diff --git a/idp-attribute-resolver-spring/src/test/resources/net/shibboleth/idp/attribute/resolver/spring/attribute-resolver.xml b/idp-attribute-resolver-spring/src/test/resources/net/shibboleth/idp/attribute/resolver/spring/attribute-resolver.xml
index fba76d169..4bf0564c6 100644
--- a/idp-attribute-resolver-spring/src/test/resources/net/shibboleth/idp/attribute/resolver/spring/attribute-resolver.xml
+++ b/idp-attribute-resolver-spring/src/test/resources/net/shibboleth/idp/attribute/resolver/spring/attribute-resolver.xml
@@ -233,8 +233,9 @@
<!-- Example LDAP Connector -->
<DataConnector id="myLDAP" xsi:type="LDAPDirectory"
- ldapURL="ldap://localhost:10391"
+ ldapURL="ldap://localhost:10391"
baseDN="dc=shibboleth,dc=net"
+ failFastInitialize="false"
connectTimeout="PT6S"
responseTimeout="PT6S"
principal="cn=Directory Manager"
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the commits
mailing list