[java-identity-provider] 05/06: Stop using deprecated syntax in test

Rod Widdowson rdw at steadingsoftware.com
Sun Mar 3 09:59:38 EST 2019


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

rdw 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=f60a1d9955bc45f35bc7b8689068dcf253a95b42

commit f60a1d9955bc45f35bc7b8689068dcf253a95b42
Author: Rod Widdowson <rdw at steadingsoftware.com>
AuthorDate: Sun Mar 3 14:10:45 2019 +0000

    Stop using deprecated syntax in test
---
 .../metadata/DynamicHTTPMetadataProviderParserTest.java           | 6 +++---
 .../relyingparty/metadata/HTTPMetadataProviderParserTest.java     | 6 +++---
 .../spring/relyingparty/metadata/dynamic-httpCaching-file.xml     | 7 ++-----
 .../spring/relyingparty/metadata/dynamic-httpCaching-memory.xml   | 4 +---
 .../spring/relyingparty/metadata/dynamic-httpCaching-none.xml     | 2 +-
 .../spring/relyingparty/metadata/http-entity-httpCaching-file.xml | 5 +----
 .../relyingparty/metadata/http-entity-httpCaching-memory.xml      | 4 +---
 .../spring/relyingparty/metadata/http-entity-httpCaching-none.xml | 2 +-
 .../idp/profile/spring/relyingparty/metadata/httpClient.xml       | 8 ++++++--
 9 files changed, 19 insertions(+), 25 deletions(-)

diff --git a/idp-profile-spring/src/test/java/net/shibboleth/idp/profile/spring/relyingparty/metadata/DynamicHTTPMetadataProviderParserTest.java b/idp-profile-spring/src/test/java/net/shibboleth/idp/profile/spring/relyingparty/metadata/DynamicHTTPMetadataProviderParserTest.java
index f85f15b..6be03d2 100644
--- a/idp-profile-spring/src/test/java/net/shibboleth/idp/profile/spring/relyingparty/metadata/DynamicHTTPMetadataProviderParserTest.java
+++ b/idp-profile-spring/src/test/java/net/shibboleth/idp/profile/spring/relyingparty/metadata/DynamicHTTPMetadataProviderParserTest.java
@@ -325,7 +325,7 @@ public class DynamicHTTPMetadataProviderParserTest extends AbstractMetadataParse
                 RepositorySupport.buildHTTPResourceURL(REPO_OPENSAML, TEMPLATE_URL, false));
         
         final FunctionDrivenDynamicHTTPMetadataResolver resolver = getBean(FunctionDrivenDynamicHTTPMetadataResolver.class, 
-                propSource, "dynamic-httpCaching-none.xml", "beans.xml");
+                propSource, "dynamic-httpCaching-none.xml", "beans.xml", "httpClient.xml");
         
         final String entityID = "https://www.example.org/sp";
         
@@ -342,7 +342,7 @@ public class DynamicHTTPMetadataProviderParserTest extends AbstractMetadataParse
                 RepositorySupport.buildHTTPResourceURL(REPO_OPENSAML, TEMPLATE_URL, false));
         
         final FunctionDrivenDynamicHTTPMetadataResolver resolver = getBean(FunctionDrivenDynamicHTTPMetadataResolver.class, 
-                propSource, "dynamic-httpCaching-memory.xml", "beans.xml");
+                propSource, "dynamic-httpCaching-memory.xml", "beans.xml", "httpClient.xml");
         
         final String entityID = "https://www.example.org/sp";
         
@@ -359,7 +359,7 @@ public class DynamicHTTPMetadataProviderParserTest extends AbstractMetadataParse
                 RepositorySupport.buildHTTPResourceURL(REPO_OPENSAML, TEMPLATE_URL, false));
         
         final FunctionDrivenDynamicHTTPMetadataResolver resolver = getBean(FunctionDrivenDynamicHTTPMetadataResolver.class, 
-                propSource, "dynamic-httpCaching-file.xml", "beans.xml");
+                propSource, "dynamic-httpCaching-file.xml", "beans.xml", "httpClient.xml");
         
         final String entityID = "https://www.example.org/sp";
         
diff --git a/idp-profile-spring/src/test/java/net/shibboleth/idp/profile/spring/relyingparty/metadata/HTTPMetadataProviderParserTest.java b/idp-profile-spring/src/test/java/net/shibboleth/idp/profile/spring/relyingparty/metadata/HTTPMetadataProviderParserTest.java
index 0845ad9..044d632 100644
--- a/idp-profile-spring/src/test/java/net/shibboleth/idp/profile/spring/relyingparty/metadata/HTTPMetadataProviderParserTest.java
+++ b/idp-profile-spring/src/test/java/net/shibboleth/idp/profile/spring/relyingparty/metadata/HTTPMetadataProviderParserTest.java
@@ -130,7 +130,7 @@ public class HTTPMetadataProviderParserTest extends AbstractMetadataParserTest {
         MockPropertySource propSource = singletonPropertySource(PROP_MDURL, 
                 RepositorySupport.buildHTTPResourceURL(REPO_IDP, ENTITY_XML, false));
 
-        HTTPMetadataResolver resolver = getBean(HTTPMetadataResolver.class, propSource, "http-entity-httpCaching-none.xml", "beans.xml");
+        HTTPMetadataResolver resolver = getBean(HTTPMetadataResolver.class, propSource, "http-entity-httpCaching-none.xml", "beans.xml", "httpClient.xml");
         
         Assert.assertEquals(resolver.getId(), "HTTPEntity");
         Assert.assertNotNull(resolver.resolveSingle(criteriaFor(IDP_ID)));
@@ -141,7 +141,7 @@ public class HTTPMetadataProviderParserTest extends AbstractMetadataParserTest {
         MockPropertySource propSource = singletonPropertySource(PROP_MDURL, 
                 RepositorySupport.buildHTTPResourceURL(REPO_IDP, ENTITY_XML, false));
 
-        HTTPMetadataResolver resolver = getBean(HTTPMetadataResolver.class, propSource, "http-entity-httpCaching-memory.xml", "beans.xml");
+        HTTPMetadataResolver resolver = getBean(HTTPMetadataResolver.class, propSource, "http-entity-httpCaching-memory.xml", "beans.xml", "httpClient.xml");
         
         Assert.assertEquals(resolver.getId(), "HTTPEntity");
         Assert.assertNotNull(resolver.resolveSingle(criteriaFor(IDP_ID)));
@@ -154,7 +154,7 @@ public class HTTPMetadataProviderParserTest extends AbstractMetadataParserTest {
         MockPropertySource propSource = singletonPropertySource(PROP_MDURL, 
                 RepositorySupport.buildHTTPResourceURL(REPO_IDP, ENTITY_XML, false));
 
-        HTTPMetadataResolver resolver = getBean(HTTPMetadataResolver.class, propSource, "http-entity-httpCaching-file.xml", "beans.xml");
+        HTTPMetadataResolver resolver = getBean(HTTPMetadataResolver.class, propSource, "http-entity-httpCaching-file.xml", "beans.xml", "httpClient.xml");
         
         Assert.assertEquals(resolver.getId(), "HTTPEntity");
         Assert.assertNotNull(resolver.resolveSingle(criteriaFor(IDP_ID)));
diff --git a/idp-profile-spring/src/test/resources/net/shibboleth/idp/profile/spring/relyingparty/metadata/dynamic-httpCaching-file.xml b/idp-profile-spring/src/test/resources/net/shibboleth/idp/profile/spring/relyingparty/metadata/dynamic-httpCaching-file.xml
index 645d8e23..a955ccb 100644
--- a/idp-profile-spring/src/test/resources/net/shibboleth/idp/profile/spring/relyingparty/metadata/dynamic-httpCaching-file.xml
+++ b/idp-profile-spring/src/test/resources/net/shibboleth/idp/profile/spring/relyingparty/metadata/dynamic-httpCaching-file.xml
@@ -4,11 +4,8 @@
 	xsi:schemaLocation="urn:mace:shibboleth:2.0:metadata http://shibboleth.net/schema/idp/shibboleth-metadata.xsd
                        urn:oasis:names:tc:SAML:2.0:metadata http://docs.oasis-open.org/security/saml/v2.0/saml-schema-metadata-2.0.xsd"
 
-	id="dynamicHttpCachingFile" 
-    httpCaching="file"
-    httpCacheDirectory="#{systemProperties['java.io.tmpdir']}/httpProviderCacheTest"
-    httpMaxCacheEntries="100"
-    httpMaxCacheEntrySize="104857600"
+	id="dynamicHttpCachingFile"
+    httpClientRef="fileClient"
     xsi:type="metadata:DynamicHTTPMetadataProvider" >
     
     <!-- Note: use of the transformRef here is mostly just to facilitate testing. -->
diff --git a/idp-profile-spring/src/test/resources/net/shibboleth/idp/profile/spring/relyingparty/metadata/dynamic-httpCaching-memory.xml b/idp-profile-spring/src/test/resources/net/shibboleth/idp/profile/spring/relyingparty/metadata/dynamic-httpCaching-memory.xml
index 696c297..1f5b03e 100644
--- a/idp-profile-spring/src/test/resources/net/shibboleth/idp/profile/spring/relyingparty/metadata/dynamic-httpCaching-memory.xml
+++ b/idp-profile-spring/src/test/resources/net/shibboleth/idp/profile/spring/relyingparty/metadata/dynamic-httpCaching-memory.xml
@@ -5,9 +5,7 @@
                        urn:oasis:names:tc:SAML:2.0:metadata http://docs.oasis-open.org/security/saml/v2.0/saml-schema-metadata-2.0.xsd"
 
 	id="dynamicHttpCachingMemory" 
-    httpCaching="memory"
-    httpMaxCacheEntries="100"
-    httpMaxCacheEntrySize="104857600"
+    httpClientRef="memClient"
     xsi:type="metadata:DynamicHTTPMetadataProvider" >
     
     <!-- Note: use of the transformRef here is mostly just to facilitate testing. -->
diff --git a/idp-profile-spring/src/test/resources/net/shibboleth/idp/profile/spring/relyingparty/metadata/dynamic-httpCaching-none.xml b/idp-profile-spring/src/test/resources/net/shibboleth/idp/profile/spring/relyingparty/metadata/dynamic-httpCaching-none.xml
index e9c2a21..36812cc 100644
--- a/idp-profile-spring/src/test/resources/net/shibboleth/idp/profile/spring/relyingparty/metadata/dynamic-httpCaching-none.xml
+++ b/idp-profile-spring/src/test/resources/net/shibboleth/idp/profile/spring/relyingparty/metadata/dynamic-httpCaching-none.xml
@@ -5,7 +5,7 @@
                        urn:oasis:names:tc:SAML:2.0:metadata http://docs.oasis-open.org/security/saml/v2.0/saml-schema-metadata-2.0.xsd"
 
 	id="dynamicHttpCachingNone" 
-    httpCaching="none"
+    httpClientRef="noneClient"
     xsi:type="metadata:DynamicHTTPMetadataProvider" >
     
     <!-- Note: use of the transformRef here is mostly just to facilitate testing. -->
diff --git a/idp-profile-spring/src/test/resources/net/shibboleth/idp/profile/spring/relyingparty/metadata/http-entity-httpCaching-file.xml b/idp-profile-spring/src/test/resources/net/shibboleth/idp/profile/spring/relyingparty/metadata/http-entity-httpCaching-file.xml
index 17d6c2d..51bd895 100644
--- a/idp-profile-spring/src/test/resources/net/shibboleth/idp/profile/spring/relyingparty/metadata/http-entity-httpCaching-file.xml
+++ b/idp-profile-spring/src/test/resources/net/shibboleth/idp/profile/spring/relyingparty/metadata/http-entity-httpCaching-file.xml
@@ -7,10 +7,7 @@
 	id="HTTPEntity" 
     xsi:type="metadata:FileBackedHTTPMetadataProvider"
     backingFile="%{DIR}/spoolhttpentitycaching-file.xml"
-    httpCaching="file"
-    httpCacheDirectory="#{systemProperties['java.io.tmpdir']}/httpProviderCacheTest"
-    httpMaxCacheEntries="100"
-    httpMaxCacheEntrySize="104857600"
+    httpClientRef="fileClient"
     metadataURL="%{metadataURL}"> 
 
 </metadata:MetadataProvider>
diff --git a/idp-profile-spring/src/test/resources/net/shibboleth/idp/profile/spring/relyingparty/metadata/http-entity-httpCaching-memory.xml b/idp-profile-spring/src/test/resources/net/shibboleth/idp/profile/spring/relyingparty/metadata/http-entity-httpCaching-memory.xml
index da0fbc4..6d1f55f 100644
--- a/idp-profile-spring/src/test/resources/net/shibboleth/idp/profile/spring/relyingparty/metadata/http-entity-httpCaching-memory.xml
+++ b/idp-profile-spring/src/test/resources/net/shibboleth/idp/profile/spring/relyingparty/metadata/http-entity-httpCaching-memory.xml
@@ -7,9 +7,7 @@
 	id="HTTPEntity" 
     xsi:type="metadata:FileBackedHTTPMetadataProvider"
     backingFile="%{DIR}/spoolhttpcaching-memory.xml"
-    httpCaching="memory"
-    httpMaxCacheEntries="100"
-    httpMaxCacheEntrySize="104857600"
+    httpClientRef="memClient"
     metadataURL="%{metadataURL}"> 
 
 </metadata:MetadataProvider>
diff --git a/idp-profile-spring/src/test/resources/net/shibboleth/idp/profile/spring/relyingparty/metadata/http-entity-httpCaching-none.xml b/idp-profile-spring/src/test/resources/net/shibboleth/idp/profile/spring/relyingparty/metadata/http-entity-httpCaching-none.xml
index be0f810..b1e5051 100644
--- a/idp-profile-spring/src/test/resources/net/shibboleth/idp/profile/spring/relyingparty/metadata/http-entity-httpCaching-none.xml
+++ b/idp-profile-spring/src/test/resources/net/shibboleth/idp/profile/spring/relyingparty/metadata/http-entity-httpCaching-none.xml
@@ -7,7 +7,7 @@
 	id="HTTPEntity" 
     xsi:type="metadata:FileBackedHTTPMetadataProvider"
     backingFile="%{DIR}/spoolhttpentitycaching none.xml"
-    httpCaching="none"
+    httpClientRef="noneClient"
     metadataURL="%{metadataURL}"> 
 
 </metadata:MetadataProvider>
diff --git a/idp-profile-spring/src/test/resources/net/shibboleth/idp/profile/spring/relyingparty/metadata/httpClient.xml b/idp-profile-spring/src/test/resources/net/shibboleth/idp/profile/spring/relyingparty/metadata/httpClient.xml
index c6d1e66..c981078 100644
--- a/idp-profile-spring/src/test/resources/net/shibboleth/idp/profile/spring/relyingparty/metadata/httpClient.xml
+++ b/idp-profile-spring/src/test/resources/net/shibboleth/idp/profile/spring/relyingparty/metadata/httpClient.xml
@@ -10,10 +10,14 @@
 	default-init-method="initialize" default-destroy-method="destroy">
 
 	<bean id="clientBuilder" class="net.shibboleth.utilities.java.support.httpclient.HttpClientBuilder"
-		p:userAgent="disguised/1.0.0 hidden/3.4.5" />
+		p:userAgent="disguised/1.0.0 hidden/3.4.5" lazy-init="true"/>
 
     <bean id="apacheClient"
         factory-bean="clientBuilder"
-        factory-method="buildClient"/>
+        factory-method="buildClient" lazy-init="true"/>
+       
+    <bean id="noneClient" class="net.shibboleth.idp.profile.spring.relyingparty.metadata.HttpClientFactoryBean" lazy-init="true"/>
+    <bean id="fileClient" class="net.shibboleth.idp.profile.spring.relyingparty.metadata.FileCachingHttpClientFactoryBean" lazy-init="true"/>
+    <bean id="memClient" class="net.shibboleth.idp.profile.spring.relyingparty.metadata.InMemoryCachingHttpClientFactoryBean" lazy-init="true"/>
 
 </beans>
\ No newline at end of file

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


More information about the commits mailing list