[java-identity-provider] branch master updated: Switch tests to use HttpClientBuilder instead of FactoryBean.

Scott Cantor cantor.2 at osu.edu
Wed Jan 17 14:27:31 EST 2018


This is an automated email from the git hooks/post-receive script.

scantor pushed a commit to branch master
in repository java-identity-provider.

View the commit online:
http://git.shibboleth.net/view/?p=java-identity-provider.git;a=commit;h=38f8db42e2f5adba38a6a4d09fb4bfdc7b46cf84

The following commit(s) were added to refs/heads/master by this push:
       new  38f8db4   Switch tests to use HttpClientBuilder instead of FactoryBean.
38f8db4 is described below

commit 38f8db42e2f5adba38a6a4d09fb4bfdc7b46cf84
Author: Scott Cantor <cantor.2 at osu.edu>
AuthorDate: Wed Jan 17 14:27:28 2018 -0500

    Switch tests to use HttpClientBuilder instead of FactoryBean.
---
 .../spring/dc/http/HTTPDataConnectorParserTest.java  | 12 ++++++++++++
 .../resolver/spring/dc/http/spring-beans.xml         | 20 ++++++++++++++------
 2 files changed, 26 insertions(+), 6 deletions(-)

diff --git a/idp-attribute-resolver-spring/src/test/java/net/shibboleth/idp/attribute/resolver/spring/dc/http/HTTPDataConnectorParserTest.java b/idp-attribute-resolver-spring/src/test/java/net/shibboleth/idp/attribute/resolver/spring/dc/http/HTTPDataConnectorParserTest.java
index 67c310a..7673949 100644
--- a/idp-attribute-resolver-spring/src/test/java/net/shibboleth/idp/attribute/resolver/spring/dc/http/HTTPDataConnectorParserTest.java
+++ b/idp-attribute-resolver-spring/src/test/java/net/shibboleth/idp/attribute/resolver/spring/dc/http/HTTPDataConnectorParserTest.java
@@ -74,6 +74,7 @@ public class HTTPDataConnectorParserTest {
         
         final MockPropertySource propSource = singletonPropertySource("serviceURL", TEST_URL);
         propSource.setProperty("scriptPath", (TestSupport.isJavaV8OrLater() ? SCRIPT_PATH_V8 : SCRIPT_PATH) + "test.js");
+        propSource.setProperty("userAgent", "disguised/1.0.0 hidden/3.4.5");
         
         final HTTPDataConnector connector =
                 getDataConnector(propSource,
@@ -102,6 +103,7 @@ public class HTTPDataConnectorParserTest {
         
         final MockPropertySource propSource = singletonPropertySource("serviceURL", TEST_URL);
         propSource.setProperty("scriptPath", (TestSupport.isJavaV8OrLater() ? SCRIPT_PATH_V8 : SCRIPT_PATH) + "test.js");
+        propSource.setProperty("userAgent", "disguised/1.0.0 hidden/3.4.5");
         
         final HTTPDataConnector connector =
                 getDataConnector(propSource,
@@ -119,6 +121,7 @@ public class HTTPDataConnectorParserTest {
         
         final MockPropertySource propSource = singletonPropertySource("serviceURL", TEST_URL);
         propSource.setProperty("scriptPath", (TestSupport.isJavaV8OrLater() ? SCRIPT_PATH_V8 : SCRIPT_PATH) + "testsize.js");
+        propSource.setProperty("userAgent", "disguised/1.0.0 hidden/3.4.5");
         
         final HTTPDataConnector connector =
                 getDataConnector(propSource,
@@ -136,6 +139,7 @@ public class HTTPDataConnectorParserTest {
         
         final MockPropertySource propSource = singletonPropertySource("serviceURL", "https://build.shibboleth.net/test.json");
         propSource.setProperty("scriptPath", (TestSupport.isJavaV8OrLater() ? SCRIPT_PATH_V8 : SCRIPT_PATH) + "test.js");
+        propSource.setProperty("userAgent", "disguised/1.0.0 hidden/3.4.5");
         
         final HTTPDataConnector connector =
                 getDataConnector(propSource,
@@ -153,6 +157,7 @@ public class HTTPDataConnectorParserTest {
         
         final MockPropertySource propSource = singletonPropertySource("serviceURL", "https://build.shibboleth.net/test.json");
         propSource.setProperty("scriptPath", (TestSupport.isJavaV8OrLater() ? SCRIPT_PATH_V8 : SCRIPT_PATH) + "test.js");
+        propSource.setProperty("userAgent", "disguised/1.0.0 hidden/3.4.5");
         
         final HTTPDataConnector connector =
                 getDataConnector(propSource,
@@ -172,6 +177,7 @@ public class HTTPDataConnectorParserTest {
         
         final MockPropertySource propSource = singletonPropertySource("serviceURL", TEST_URL);
         propSource.setProperty("scriptPath", (TestSupport.isJavaV8OrLater() ? SCRIPT_PATH_V8 : SCRIPT_PATH) + "test.js");
+        propSource.setProperty("userAgent", "disguised/1.0.0 hidden/3.4.5");
         propSource.setProperty("certificate", "/org/opensaml/saml/metadata/resolver/impl/repo-entity.crt");
         
         final HTTPDataConnector connector =
@@ -201,6 +207,7 @@ public class HTTPDataConnectorParserTest {
         
         final MockPropertySource propSource = singletonPropertySource("serviceURL", TEST_URL);
         propSource.setProperty("scriptPath", (TestSupport.isJavaV8OrLater() ? SCRIPT_PATH_V8 : SCRIPT_PATH) + "test.js");
+        propSource.setProperty("userAgent", "disguised/1.0.0 hidden/3.4.5");
         propSource.setProperty("certificate", "/org/opensaml/saml/metadata/resolver/impl/badKey.crt");
         
         final HTTPDataConnector connector =
@@ -219,6 +226,7 @@ public class HTTPDataConnectorParserTest {
         
         final MockPropertySource propSource = singletonPropertySource("serviceURL", TEST_URL);
         propSource.setProperty("scriptPath", (TestSupport.isJavaV8OrLater() ? SCRIPT_PATH_V8 : SCRIPT_PATH) + "test.js");
+        propSource.setProperty("userAgent", "disguised/1.0.0 hidden/3.4.5");
         propSource.setProperty("certificateAuthority", "/org/opensaml/saml/metadata/resolver/impl/repo-rootCA.crt");
         
         final HTTPDataConnector connector =
@@ -248,6 +256,7 @@ public class HTTPDataConnectorParserTest {
         
         final MockPropertySource propSource = singletonPropertySource("serviceURL", TEST_URL);
         propSource.setProperty("scriptPath", (TestSupport.isJavaV8OrLater() ? SCRIPT_PATH_V8 : SCRIPT_PATH) + "test.js");
+        propSource.setProperty("userAgent", "disguised/1.0.0 hidden/3.4.5");
         propSource.setProperty("certificateAuthority", "/org/opensaml/saml/metadata/resolver/impl/badCA.crt");
         
         final HTTPDataConnector connector =
@@ -268,6 +277,7 @@ public class HTTPDataConnectorParserTest {
         
         final MockPropertySource propSource = singletonPropertySource("serviceURL", TEST_URL);
         propSource.setProperty("scriptPath", (TestSupport.isJavaV8OrLater() ? SCRIPT_PATH_V8 : SCRIPT_PATH) + "test.js");
+        propSource.setProperty("userAgent", "disguised/1.0.0 hidden/3.4.5");
         propSource.setProperty("key", "net/shibboleth/idp/attribute/resolver/spring/dc/http/client.key");
         propSource.setProperty("certificate", "net/shibboleth/idp/attribute/resolver/spring/dc/http/client.crt");
         
@@ -297,6 +307,7 @@ public class HTTPDataConnectorParserTest {
     @Test public void hybridConfig() throws Exception {
         final MockPropertySource propSource = singletonPropertySource("serviceURL", TEST_URL);
         propSource.setProperty("scriptPath", (TestSupport.isJavaV8OrLater() ? SCRIPT_PATH_V8 : SCRIPT_PATH) + "test.js");
+        propSource.setProperty("userAgent", "disguised/1.0.0 hidden/3.4.5");
         
         final HTTPDataConnector connector =
                 getDataConnector(propSource,
@@ -328,6 +339,7 @@ public class HTTPDataConnectorParserTest {
         propSource.setProperty("serviceBody",
                 "[{\"name\" : \"foo\",\"values\" : [ \"foo1\" ]},{\"name\" : \"bar\",\"values\" : [ \"bar1\", \"bar2\" ]}]");
         propSource.setProperty("scriptPath", (TestSupport.isJavaV8OrLater() ? SCRIPT_PATH_V8 : SCRIPT_PATH) + "test.js");
+        propSource.setProperty("userAgent", "disguised/1.0.0 hidden/3.4.5");
         
         final HTTPDataConnector connector =
                 getDataConnector(propSource,
diff --git a/idp-attribute-resolver-spring/src/test/resources/net/shibboleth/idp/attribute/resolver/spring/dc/http/spring-beans.xml b/idp-attribute-resolver-spring/src/test/resources/net/shibboleth/idp/attribute/resolver/spring/dc/http/spring-beans.xml
index 7342e5f..592244a 100644
--- a/idp-attribute-resolver-spring/src/test/resources/net/shibboleth/idp/attribute/resolver/spring/dc/http/spring-beans.xml
+++ b/idp-attribute-resolver-spring/src/test/resources/net/shibboleth/idp/attribute/resolver/spring/dc/http/spring-beans.xml
@@ -8,24 +8,32 @@
 
     <bean id="CustomObject" class="java.lang.String" c:_0="foo" />
 
-    <bean id="NoTrustEngineHttpClient"
-        class="net.shibboleth.idp.profile.spring.relyingparty.metadata.HttpClientFactoryBean" />
+    <bean id="NoTrustEngineHttpClientBuilder"
+        class="net.shibboleth.idp.http.HttpClientBuilder"
+        p:userAgent="%{userAgent}"
+        p:connectionTimeout="PT30S" />
+
+    <bean id="NoTrustEngineHttpClient" factory-bean="NoTrustEngineHttpClientBuilder" factory-method="buildClient" />
 
     <bean id="SecurityEnhancedTLSSocketFactory" 
         class="org.opensaml.security.httpclient.impl.SecurityEnhancedHttpClientSupport"
         factory-method="buildTLSSocketFactory" />
 
-    <bean id="TrustEngineHttpClient"
-        class="net.shibboleth.idp.profile.spring.relyingparty.metadata.HttpClientFactoryBean"
+    <bean id="TrustEngineHttpClientBuilder"
+        parent="NoTrustEngineHttpClientBuilder"
         p:TLSSocketFactory-ref="SecurityEnhancedTLSSocketFactory" />
 
+    <bean id="TrustEngineHttpClient" factory-bean="TrustEngineHttpClientBuilder" factory-method="buildClient" />
+
     <bean id="ClientTLSSocketFactory" 
         class="org.opensaml.security.httpclient.impl.SecurityEnhancedHttpClientSupport"
         factory-method="buildTLSSocketFactoryWithClientTLSOnly" />
 
-    <bean id="ClientTLSHttpClient"
-        class="net.shibboleth.idp.profile.spring.relyingparty.metadata.HttpClientFactoryBean"
+    <bean id="ClientTLSHttpClientBuilder"
+        parent="NoTrustEngineHttpClientBuilder"
         p:TLSSocketFactory-ref="ClientTLSSocketFactory" />
+        
+    <bean id="ClientTLSHttpClient" factory-bean="ClientTLSHttpClientBuilder" factory-method="buildClient" />
 
     <bean id="BadProtocolParameters"
         class="org.opensaml.security.httpclient.HttpClientSecurityParameters"

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the commits mailing list