[java-identity-provider] branch main updated: JSSH-71 Remove the impact of the DestructableComponent Interface

Codeberg noreply at shibboleth.net
Sun Jul 26 14:40:13 UTC 2026


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

codeberg pushed a commit to branch main
in repository java-identity-provider.

View the commit online:
https://codeberg.org/Shibboleth/java-identity-provider/commit/04f67827219422656dbd93c1be0bc51497745cf9

The following commit(s) were added to refs/heads/main by this push:
     new 04f678272 JSSH-71 Remove the impact of the DestructableComponent Interface
04f678272 is described below

commit 04f67827219422656dbd93c1be0bc51497745cf9
Author: Rod Widdowson <rdw at steadingsoftware.com>
AuthorDate: Sun Jul 26 15:40:18 2026 +0100

    JSSH-71 Remove the impact of the DestructableComponent Interface
    
    https://shibboleth.atlassian.net/browse/JSSH-71
    
    Remove calls to destroy() (explicit, or implicit in spring files) from
    test code.
---
 .../idp/admin/impl/DoStorageOperationTest.java     |  5 +++--
 .../impl/AttributeRevocationConditionTest.java     |  3 ++-
 .../impl/RevocationCacheConditionTest.java         |  7 +++---
 .../resolver/spring/contextDerivedBeans.xml        |  3 +--
 .../idp/attribute/resolver/spring/customBean.xml   |  3 +--
 .../impl/CASDateTimeAttributeTranscoderTest.java   |  6 ------
 .../CASScopedStringAttributeTranscoderTest.java    | 14 ++++--------
 .../impl/CASStringAttributeTranscoderTest.java     |  6 ------
 .../service/impl/MetadataServiceRegistryTest.java  |  3 ++-
 .../saml2/profile/impl/SAMLAuthnController.java    |  5 ++---
 ...oTransientSAML1NameIdentifierGeneratorTest.java | 25 ++++++++--------------
 .../CryptoTransientSAML2NameIDGeneratorTest.java   | 25 ++++++++--------------
 ...dTransientSAML1NameIdentifierGeneratorTest.java | 19 ++++++----------
 .../StoredTransientSAML2NameIDGeneratorTest.java   | 19 ++++++----------
 .../profile/impl/SessionManagerBaseTestCase.java   | 20 +++++++++--------
 .../idp/saml/impl/profile/saml1Mapper.xml          |  3 +--
 .../idp/saml/impl/profile/saml2Mapper.xml          |  3 +--
 .../session/impl/SessionManagerBaseTestCase.java   |  5 +++--
 18 files changed, 65 insertions(+), 109 deletions(-)

diff --git a/idp-admin-impl/src/test/java/net/shibboleth/idp/admin/impl/DoStorageOperationTest.java b/idp-admin-impl/src/test/java/net/shibboleth/idp/admin/impl/DoStorageOperationTest.java
index ba7bf095e..18cea2427 100644
--- a/idp-admin-impl/src/test/java/net/shibboleth/idp/admin/impl/DoStorageOperationTest.java
+++ b/idp-admin-impl/src/test/java/net/shibboleth/idp/admin/impl/DoStorageOperationTest.java
@@ -41,6 +41,7 @@ import net.shibboleth.idp.profile.testing.ActionTestingSupport;
 import net.shibboleth.idp.profile.testing.RequestContextBuilder;
 import net.shibboleth.shared.annotation.constraint.NotEmpty;
 import net.shibboleth.shared.component.ComponentInitializationException;
+import net.shibboleth.shared.primitive.AnnotationsSupport;
 import net.shibboleth.shared.testing.ConstantSupplier;
 
 /**
@@ -104,8 +105,8 @@ public class DoStorageOperationTest {
      */
     @AfterMethod
     public void tearDown() {
-        action.destroy();
-        storageService.destroy();
+        AnnotationsSupport.callOnTeardownAnnotations(action);
+        AnnotationsSupport.callOnTeardownAnnotations(storageService);
     }
 
     /**
diff --git a/idp-authn-impl/src/test/java/net/shibboleth/idp/authn/revocation/impl/AttributeRevocationConditionTest.java b/idp-authn-impl/src/test/java/net/shibboleth/idp/authn/revocation/impl/AttributeRevocationConditionTest.java
index 0fba1abc4..ca77a04c4 100644
--- a/idp-authn-impl/src/test/java/net/shibboleth/idp/authn/revocation/impl/AttributeRevocationConditionTest.java
+++ b/idp-authn-impl/src/test/java/net/shibboleth/idp/authn/revocation/impl/AttributeRevocationConditionTest.java
@@ -32,6 +32,7 @@ import net.shibboleth.idp.authn.impl.testing.BaseAuthenticationContextTest;
 import net.shibboleth.shared.collection.CollectionSupport;
 import net.shibboleth.shared.component.ComponentInitializationException;
 import net.shibboleth.shared.logic.FunctionSupport;
+import net.shibboleth.shared.primitive.AnnotationsSupport;
 import net.shibboleth.shared.service.ReloadableService;
 import net.shibboleth.shared.service.ServiceableComponent;
 
@@ -63,7 +64,7 @@ public class AttributeRevocationConditionTest extends BaseAuthenticationContextT
     
     @AfterMethod
     public void tearDown() {
-        condition.destroy();
+        AnnotationsSupport.callOnTeardownAnnotations(condition);
     }
     
     
diff --git a/idp-authn-impl/src/test/java/net/shibboleth/idp/authn/revocation/impl/RevocationCacheConditionTest.java b/idp-authn-impl/src/test/java/net/shibboleth/idp/authn/revocation/impl/RevocationCacheConditionTest.java
index 8c7fc0a9f..65ca5ec61 100644
--- a/idp-authn-impl/src/test/java/net/shibboleth/idp/authn/revocation/impl/RevocationCacheConditionTest.java
+++ b/idp-authn-impl/src/test/java/net/shibboleth/idp/authn/revocation/impl/RevocationCacheConditionTest.java
@@ -25,6 +25,7 @@ import net.shibboleth.idp.authn.impl.testing.BaseAuthenticationContextTest;
 import net.shibboleth.shared.collection.CollectionSupport;
 import net.shibboleth.shared.component.ComponentInitializationException;
 import net.shibboleth.shared.logic.FunctionSupport;
+import net.shibboleth.shared.primitive.AnnotationsSupport;
 
 import org.opensaml.storage.impl.MemoryStorageService;
 import org.opensaml.storage.impl.StorageServiceRevocationCache;
@@ -65,9 +66,9 @@ public class RevocationCacheConditionTest extends BaseAuthenticationContextTest
     
     @AfterMethod
     public void tearDown() {
-        condition.destroy();
-        revocationCache.destroy();
-        storageService.destroy();
+        AnnotationsSupport.callOnTeardownAnnotations(storageService);
+        AnnotationsSupport.callOnTeardownAnnotations(revocationCache);
+        AnnotationsSupport.callOnTeardownAnnotations(condition);
     }
     
     
diff --git a/idp-authn-impl/src/test/resources/net/shibboleth/idp/attribute/resolver/spring/contextDerivedBeans.xml b/idp-authn-impl/src/test/resources/net/shibboleth/idp/attribute/resolver/spring/contextDerivedBeans.xml
index 08f94d5af..1060b69a2 100644
--- a/idp-authn-impl/src/test/resources/net/shibboleth/idp/attribute/resolver/spring/contextDerivedBeans.xml
+++ b/idp-authn-impl/src/test/resources/net/shibboleth/idp/attribute/resolver/spring/contextDerivedBeans.xml
@@ -8,8 +8,7 @@
                            http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd
                            http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util.xsd"
                            
-       default-init-method="initialize"
-       default-destroy-method="destroy">
+       default-init-method="initialize">
        
     <bean id="princialAttributeValuesFunction" class="net.shibboleth.idp.authn.context.impl.IdPAttributePrincipalValuesFunction" 
     p:attributeName="BeanWhatever"/>    
diff --git a/idp-authn-impl/src/test/resources/net/shibboleth/idp/attribute/resolver/spring/customBean.xml b/idp-authn-impl/src/test/resources/net/shibboleth/idp/attribute/resolver/spring/customBean.xml
index 86c5c3a17..1d3f48b03 100644
--- a/idp-authn-impl/src/test/resources/net/shibboleth/idp/attribute/resolver/spring/customBean.xml
+++ b/idp-authn-impl/src/test/resources/net/shibboleth/idp/attribute/resolver/spring/customBean.xml
@@ -8,8 +8,7 @@
                            http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd
                            http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util.xsd"
                            
-       default-init-method="initialize"
-       default-destroy-method="destroy">
+       default-init-method="initialize">
        
     <util:map id="shibboleth.CustomScriptObject">
         <entry key="foo" value="bar"/>
diff --git a/idp-cas-impl/src/test/java/net/shibboleth/idp/cas/attribute/transcoding/impl/CASDateTimeAttributeTranscoderTest.java b/idp-cas-impl/src/test/java/net/shibboleth/idp/cas/attribute/transcoding/impl/CASDateTimeAttributeTranscoderTest.java
index e3b0f18fb..e922e0295 100644
--- a/idp-cas-impl/src/test/java/net/shibboleth/idp/cas/attribute/transcoding/impl/CASDateTimeAttributeTranscoderTest.java
+++ b/idp-cas-impl/src/test/java/net/shibboleth/idp/cas/attribute/transcoding/impl/CASDateTimeAttributeTranscoderTest.java
@@ -23,7 +23,6 @@ import java.util.Map;
 import javax.annotation.Nonnull;
 
 import org.testng.Assert;
-import org.testng.annotations.AfterClass;
 import org.testng.annotations.BeforeClass;
 import org.testng.annotations.Test;
 
@@ -76,11 +75,6 @@ public class CASDateTimeAttributeTranscoderTest {
         registry.initialize();
     }
     
-    @AfterClass public void tearDown() {
-        registry.destroy();
-        registry = null;
-    }
-
     @Test public void emptyEncode() throws Exception {
         final IdPAttribute inputAttribute = new IdPAttribute(ATTR_ID);
 
diff --git a/idp-cas-impl/src/test/java/net/shibboleth/idp/cas/attribute/transcoding/impl/CASScopedStringAttributeTranscoderTest.java b/idp-cas-impl/src/test/java/net/shibboleth/idp/cas/attribute/transcoding/impl/CASScopedStringAttributeTranscoderTest.java
index 9bb8d8ff7..d84ccf36e 100644
--- a/idp-cas-impl/src/test/java/net/shibboleth/idp/cas/attribute/transcoding/impl/CASScopedStringAttributeTranscoderTest.java
+++ b/idp-cas-impl/src/test/java/net/shibboleth/idp/cas/attribute/transcoding/impl/CASScopedStringAttributeTranscoderTest.java
@@ -22,6 +22,10 @@ import java.util.Map;
 
 import javax.annotation.Nonnull;
 
+import org.testng.Assert;
+import org.testng.annotations.BeforeClass;
+import org.testng.annotations.Test;
+
 import net.shibboleth.idp.attribute.AttributeEncodingException;
 import net.shibboleth.idp.attribute.ByteAttributeValue;
 import net.shibboleth.idp.attribute.IdPAttribute;
@@ -40,11 +44,6 @@ import net.shibboleth.shared.collection.CollectionSupport;
 import net.shibboleth.shared.component.ComponentInitializationException;
 import net.shibboleth.shared.testing.MockApplicationContext;
 
-import org.testng.Assert;
-import org.testng.annotations.AfterClass;
-import org.testng.annotations.BeforeClass;
-import org.testng.annotations.Test;
-
 /** {@link CASScopedStringAttributeTranscoder} unit test. */
 @SuppressWarnings("javadoc")
 public class CASScopedStringAttributeTranscoderTest {
@@ -81,11 +80,6 @@ public class CASScopedStringAttributeTranscoderTest {
         registry.initialize();
     }
     
-    @AfterClass public void tearDown() {
-        registry.destroy();
-        registry = null;
-    }
-
     @Test public void emptyEncode() throws Exception {
         final IdPAttribute inputAttribute = new IdPAttribute(ATTR_ID);
 
diff --git a/idp-cas-impl/src/test/java/net/shibboleth/idp/cas/attribute/transcoding/impl/CASStringAttributeTranscoderTest.java b/idp-cas-impl/src/test/java/net/shibboleth/idp/cas/attribute/transcoding/impl/CASStringAttributeTranscoderTest.java
index 298151e7c..a5fbef30e 100644
--- a/idp-cas-impl/src/test/java/net/shibboleth/idp/cas/attribute/transcoding/impl/CASStringAttributeTranscoderTest.java
+++ b/idp-cas-impl/src/test/java/net/shibboleth/idp/cas/attribute/transcoding/impl/CASStringAttributeTranscoderTest.java
@@ -22,7 +22,6 @@ import java.util.Map;
 import javax.annotation.Nonnull;
 
 import org.testng.Assert;
-import org.testng.annotations.AfterClass;
 import org.testng.annotations.BeforeClass;
 import org.testng.annotations.Test;
 
@@ -76,11 +75,6 @@ public class CASStringAttributeTranscoderTest {
         registry.initialize();
     }
     
-    @AfterClass public void tearDown() {
-        registry.destroy();
-        registry = null;
-    }
-
     @Test public void emptyEncode() throws Exception {
         final IdPAttribute inputAttribute = new IdPAttribute(ATTR_ID);
 
diff --git a/idp-cas-impl/src/test/java/net/shibboleth/idp/cas/service/impl/MetadataServiceRegistryTest.java b/idp-cas-impl/src/test/java/net/shibboleth/idp/cas/service/impl/MetadataServiceRegistryTest.java
index f294ea432..4bbcf9742 100644
--- a/idp-cas-impl/src/test/java/net/shibboleth/idp/cas/service/impl/MetadataServiceRegistryTest.java
+++ b/idp-cas-impl/src/test/java/net/shibboleth/idp/cas/service/impl/MetadataServiceRegistryTest.java
@@ -38,6 +38,7 @@ import org.testng.annotations.Test;
 import net.shibboleth.idp.cas.service.Service;
 import net.shibboleth.shared.collection.CollectionSupport;
 import net.shibboleth.shared.component.ComponentInitializationException;
+import net.shibboleth.shared.primitive.AnnotationsSupport;
 import net.shibboleth.shared.resource.Resource;
 import net.shibboleth.shared.spring.resource.ResourceHelper;
 import net.shibboleth.shared.xml.ParserPool;
@@ -97,7 +98,7 @@ public class MetadataServiceRegistryTest {
 
     @AfterClass
     public void tearDown() {
-        metadataResolver.destroy();
+        AnnotationsSupport.callOnTeardownAnnotations(metadataResolver);
     }
 
     @Test(dataProvider = "parameters")
diff --git a/idp-saml-impl/src/main/java/net/shibboleth/idp/saml/saml2/profile/impl/SAMLAuthnController.java b/idp-saml-impl/src/main/java/net/shibboleth/idp/saml/saml2/profile/impl/SAMLAuthnController.java
index d8ad608f0..f1c324c18 100644
--- a/idp-saml-impl/src/main/java/net/shibboleth/idp/saml/saml2/profile/impl/SAMLAuthnController.java
+++ b/idp-saml-impl/src/main/java/net/shibboleth/idp/saml/saml2/profile/impl/SAMLAuthnController.java
@@ -37,9 +37,6 @@ import org.opensaml.saml.common.binding.SAMLBindingSupport;
 import org.opensaml.saml.common.messaging.context.SAMLMessageReceivedEndpointContext;
 import org.opensaml.saml.saml2.core.AuthnRequest;
 import org.slf4j.Logger;
-import net.shibboleth.shared.primitive.LoggerFactory;
-import net.shibboleth.shared.servlet.HttpServletRequestValidator;
-
 import org.springframework.stereotype.Controller;
 import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.PathVariable;
@@ -56,6 +53,8 @@ import net.shibboleth.shared.collection.CollectionSupport;
 import net.shibboleth.shared.component.AbstractInitializableComponent;
 import net.shibboleth.shared.component.ComponentInitializationException;
 import net.shibboleth.shared.logic.Constraint;
+import net.shibboleth.shared.primitive.LoggerFactory;
+import net.shibboleth.shared.servlet.HttpServletRequestValidator;
 
 /**
  * MVC controller that handles outbound and inbound message I/O for
diff --git a/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/nameid/impl/CryptoTransientSAML1NameIdentifierGeneratorTest.java b/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/nameid/impl/CryptoTransientSAML1NameIdentifierGeneratorTest.java
index d4750c4ef..8c2903e7e 100644
--- a/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/nameid/impl/CryptoTransientSAML1NameIdentifierGeneratorTest.java
+++ b/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/nameid/impl/CryptoTransientSAML1NameIdentifierGeneratorTest.java
@@ -17,25 +17,24 @@ package net.shibboleth.idp.saml.nameid.impl;
 import java.io.IOException;
 import java.time.Duration;
 
-import net.shibboleth.idp.authn.context.SubjectContext;
-import net.shibboleth.idp.profile.testing.RequestContextBuilder;
-import net.shibboleth.profile.context.RelyingPartyContext;
-import net.shibboleth.profile.relyingparty.RelyingPartyConfiguration;
-import net.shibboleth.shared.component.ComponentInitializationException;
-import net.shibboleth.shared.security.DataSealer;
-import net.shibboleth.shared.security.impl.BasicKeystoreKeyStrategy;
-import net.shibboleth.shared.spring.resource.ResourceHelper;
-
 import org.opensaml.core.testing.OpenSAMLInitBaseTestCase;
 import org.opensaml.profile.context.ProfileRequestContext;
 import org.opensaml.saml.saml1.core.NameIdentifier;
 import org.springframework.core.io.ClassPathResource;
 import org.springframework.core.io.Resource;
 import org.testng.Assert;
-import org.testng.annotations.AfterMethod;
 import org.testng.annotations.BeforeMethod;
 import org.testng.annotations.Test;
 
+import net.shibboleth.idp.authn.context.SubjectContext;
+import net.shibboleth.idp.profile.testing.RequestContextBuilder;
+import net.shibboleth.profile.context.RelyingPartyContext;
+import net.shibboleth.profile.relyingparty.RelyingPartyConfiguration;
+import net.shibboleth.shared.component.ComponentInitializationException;
+import net.shibboleth.shared.security.DataSealer;
+import net.shibboleth.shared.security.impl.BasicKeystoreKeyStrategy;
+import net.shibboleth.shared.spring.resource.ResourceHelper;
+
 /** Unit test for {@link TransientSAML1NameIdentifierGenerator} using crypto-based generator. */
 @SuppressWarnings({"javadoc", "null"})
 public class CryptoTransientSAML1NameIdentifierGeneratorTest extends OpenSAMLInitBaseTestCase {
@@ -81,12 +80,6 @@ public class CryptoTransientSAML1NameIdentifierGeneratorTest extends OpenSAMLIni
         generator.setTransientIdGenerator(transientGenerator);
         generator.initialize();
     }
-    
-    @AfterMethod public void tearDown() {
-        generator.destroy();
-        transientGenerator.destroy();
-        sealer.destroy();
-    }
 
     @Test public void testNoPrincipal() throws Exception {        
 
diff --git a/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/nameid/impl/CryptoTransientSAML2NameIDGeneratorTest.java b/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/nameid/impl/CryptoTransientSAML2NameIDGeneratorTest.java
index a6e3247b9..2ab20efc8 100644
--- a/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/nameid/impl/CryptoTransientSAML2NameIDGeneratorTest.java
+++ b/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/nameid/impl/CryptoTransientSAML2NameIDGeneratorTest.java
@@ -17,15 +17,6 @@ package net.shibboleth.idp.saml.nameid.impl;
 import java.io.IOException;
 import java.time.Duration;
 
-import net.shibboleth.idp.authn.context.SubjectContext;
-import net.shibboleth.idp.profile.testing.RequestContextBuilder;
-import net.shibboleth.profile.context.RelyingPartyContext;
-import net.shibboleth.profile.relyingparty.RelyingPartyConfiguration;
-import net.shibboleth.shared.component.ComponentInitializationException;
-import net.shibboleth.shared.security.DataSealer;
-import net.shibboleth.shared.security.impl.BasicKeystoreKeyStrategy;
-import net.shibboleth.shared.spring.resource.ResourceHelper;
-
 import org.opensaml.core.testing.OpenSAMLInitBaseTestCase;
 import org.opensaml.profile.context.ProfileRequestContext;
 import org.opensaml.saml.saml1.core.NameIdentifier;
@@ -33,10 +24,18 @@ import org.opensaml.saml.saml2.core.NameID;
 import org.springframework.core.io.ClassPathResource;
 import org.springframework.core.io.Resource;
 import org.testng.Assert;
-import org.testng.annotations.AfterMethod;
 import org.testng.annotations.BeforeMethod;
 import org.testng.annotations.Test;
 
+import net.shibboleth.idp.authn.context.SubjectContext;
+import net.shibboleth.idp.profile.testing.RequestContextBuilder;
+import net.shibboleth.profile.context.RelyingPartyContext;
+import net.shibboleth.profile.relyingparty.RelyingPartyConfiguration;
+import net.shibboleth.shared.component.ComponentInitializationException;
+import net.shibboleth.shared.security.DataSealer;
+import net.shibboleth.shared.security.impl.BasicKeystoreKeyStrategy;
+import net.shibboleth.shared.spring.resource.ResourceHelper;
+
 /** Unit test for {@link TransientSAML2NameIDGenerator} using crypto-based generator. */
 @SuppressWarnings({"javadoc", "null"})
 public class CryptoTransientSAML2NameIDGeneratorTest extends OpenSAMLInitBaseTestCase {
@@ -83,12 +82,6 @@ public class CryptoTransientSAML2NameIDGeneratorTest extends OpenSAMLInitBaseTes
         generator.initialize();
     }
     
-    @AfterMethod public void tearDown() {
-        generator.destroy();
-        transientGenerator.destroy();
-        sealer.destroy();
-    }
-
     @Test public void testNoPrincipal() throws Exception {        
 
         final ProfileRequestContext prc = new RequestContextBuilder().buildProfileRequestContext();
diff --git a/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/nameid/impl/StoredTransientSAML1NameIdentifierGeneratorTest.java b/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/nameid/impl/StoredTransientSAML1NameIdentifierGeneratorTest.java
index 7ad30118e..916c229c7 100644
--- a/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/nameid/impl/StoredTransientSAML1NameIdentifierGeneratorTest.java
+++ b/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/nameid/impl/StoredTransientSAML1NameIdentifierGeneratorTest.java
@@ -14,22 +14,21 @@
 
 package net.shibboleth.idp.saml.nameid.impl;
 
-import net.shibboleth.idp.authn.context.SubjectContext;
-import net.shibboleth.idp.profile.testing.RequestContextBuilder;
-import net.shibboleth.profile.context.RelyingPartyContext;
-import net.shibboleth.profile.relyingparty.RelyingPartyConfiguration;
-import net.shibboleth.shared.component.ComponentInitializationException;
-
 import org.opensaml.core.testing.OpenSAMLInitBaseTestCase;
 import org.opensaml.profile.context.ProfileRequestContext;
 import org.opensaml.saml.saml1.core.NameIdentifier;
 import org.opensaml.storage.StorageRecord;
 import org.opensaml.storage.impl.MemoryStorageService;
 import org.testng.Assert;
-import org.testng.annotations.AfterMethod;
 import org.testng.annotations.BeforeMethod;
 import org.testng.annotations.Test;
 
+import net.shibboleth.idp.authn.context.SubjectContext;
+import net.shibboleth.idp.profile.testing.RequestContextBuilder;
+import net.shibboleth.profile.context.RelyingPartyContext;
+import net.shibboleth.profile.relyingparty.RelyingPartyConfiguration;
+import net.shibboleth.shared.component.ComponentInitializationException;
+
 /** Unit test for {@link TransientSAML1NameIdentifierGenerator} using storage-based generator. */
 @SuppressWarnings({"javadoc", "null"})
 public class StoredTransientSAML1NameIdentifierGeneratorTest extends OpenSAMLInitBaseTestCase {
@@ -57,12 +56,6 @@ public class StoredTransientSAML1NameIdentifierGeneratorTest extends OpenSAMLIni
         generator.initialize();
     }
     
-    @AfterMethod public void tearDown() {
-        store.destroy();
-        transientGenerator.destroy();
-        generator.destroy();
-    }
-
     @Test public void testNoPrincipal() throws Exception {        
 
         final ProfileRequestContext prc = new RequestContextBuilder().buildProfileRequestContext();
diff --git a/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/nameid/impl/StoredTransientSAML2NameIDGeneratorTest.java b/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/nameid/impl/StoredTransientSAML2NameIDGeneratorTest.java
index 64f610fdc..f84b479d4 100644
--- a/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/nameid/impl/StoredTransientSAML2NameIDGeneratorTest.java
+++ b/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/nameid/impl/StoredTransientSAML2NameIDGeneratorTest.java
@@ -14,12 +14,6 @@
 
 package net.shibboleth.idp.saml.nameid.impl;
 
-import net.shibboleth.idp.authn.context.SubjectContext;
-import net.shibboleth.idp.profile.testing.RequestContextBuilder;
-import net.shibboleth.profile.context.RelyingPartyContext;
-import net.shibboleth.profile.relyingparty.RelyingPartyConfiguration;
-import net.shibboleth.shared.component.ComponentInitializationException;
-
 import org.opensaml.core.testing.OpenSAMLInitBaseTestCase;
 import org.opensaml.profile.context.ProfileRequestContext;
 import org.opensaml.saml.saml1.core.NameIdentifier;
@@ -27,10 +21,15 @@ import org.opensaml.saml.saml2.core.NameID;
 import org.opensaml.storage.StorageRecord;
 import org.opensaml.storage.impl.MemoryStorageService;
 import org.testng.Assert;
-import org.testng.annotations.AfterMethod;
 import org.testng.annotations.BeforeMethod;
 import org.testng.annotations.Test;
 
+import net.shibboleth.idp.authn.context.SubjectContext;
+import net.shibboleth.idp.profile.testing.RequestContextBuilder;
+import net.shibboleth.profile.context.RelyingPartyContext;
+import net.shibboleth.profile.relyingparty.RelyingPartyConfiguration;
+import net.shibboleth.shared.component.ComponentInitializationException;
+
 /** Unit test for {@link TransientSAML2NameIDGenerator} using storage-based generator. */
 @SuppressWarnings({"javadoc", "null"})
 public class StoredTransientSAML2NameIDGeneratorTest extends OpenSAMLInitBaseTestCase {
@@ -58,12 +57,6 @@ public class StoredTransientSAML2NameIDGeneratorTest extends OpenSAMLInitBaseTes
         generator.initialize();
     }
     
-    @AfterMethod public void tearDown() {
-        store.destroy();
-        transientGenerator.destroy();
-        generator.destroy();
-    }
-
     @Test public void testNoPrincipal() throws Exception {        
 
         final ProfileRequestContext prc = new RequestContextBuilder().buildProfileRequestContext();
diff --git a/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/saml2/profile/impl/SessionManagerBaseTestCase.java b/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/saml2/profile/impl/SessionManagerBaseTestCase.java
index 8abf57e4d..1777ef5b2 100644
--- a/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/saml2/profile/impl/SessionManagerBaseTestCase.java
+++ b/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/saml2/profile/impl/SessionManagerBaseTestCase.java
@@ -17,25 +17,27 @@ package net.shibboleth.idp.saml.saml2.profile.impl;
 import java.time.Duration;
 
 import javax.annotation.Nonnull;
+
+import org.opensaml.core.testing.OpenSAMLInitBaseTestCase;
+import org.opensaml.storage.impl.MemoryStorageService;
+import org.springframework.mock.web.MockHttpServletRequest;
+import org.springframework.mock.web.MockHttpServletResponse;
+import org.testng.annotations.AfterClass;
+import org.testng.annotations.BeforeClass;
+
 import jakarta.servlet.http.Cookie;
 import net.shibboleth.idp.session.SessionException;
 import net.shibboleth.idp.session.impl.StorageBackedSessionManager;
 import net.shibboleth.shared.annotation.constraint.NotEmpty;
 import net.shibboleth.shared.component.ComponentInitializationException;
 import net.shibboleth.shared.net.CookieManager;
+import net.shibboleth.shared.primitive.AnnotationsSupport;
 import net.shibboleth.shared.security.IdentifierGenerationStrategy;
 import net.shibboleth.shared.security.IdentifierGenerationStrategy.ProviderType;
 import net.shibboleth.shared.servlet.impl.HttpServletRequestResponseContext;
 import net.shibboleth.shared.servlet.impl.ThreadLocalHttpServletRequestSupplier;
 import net.shibboleth.shared.servlet.impl.ThreadLocalHttpServletResponseSupplier;
 
-import org.opensaml.core.testing.OpenSAMLInitBaseTestCase;
-import org.opensaml.storage.impl.MemoryStorageService;
-import org.springframework.mock.web.MockHttpServletRequest;
-import org.springframework.mock.web.MockHttpServletResponse;
-import org.testng.annotations.AfterClass;
-import org.testng.annotations.BeforeClass;
-
 /** Base class for tests requiring a SessionManager component to be set up. */
 @SuppressWarnings({"javadoc", "null"})
 public class SessionManagerBaseTestCase extends OpenSAMLInitBaseTestCase {
@@ -85,8 +87,8 @@ public class SessionManagerBaseTestCase extends OpenSAMLInitBaseTestCase {
     }
     
     @AfterClass public void tearDown() {
-        sessionManager.destroy();
-        storageService.destroy();
+        AnnotationsSupport.callOnTeardownAnnotations(sessionManager);
+        AnnotationsSupport.callOnTeardownAnnotations(storageService);
     }
     
     /**
diff --git a/idp-saml-impl/src/test/resources/net/shibboleth/idp/saml/impl/profile/saml1Mapper.xml b/idp-saml-impl/src/test/resources/net/shibboleth/idp/saml/impl/profile/saml1Mapper.xml
index e64708644..3507ef621 100644
--- a/idp-saml-impl/src/test/resources/net/shibboleth/idp/saml/impl/profile/saml1Mapper.xml
+++ b/idp-saml-impl/src/test/resources/net/shibboleth/idp/saml/impl/profile/saml1Mapper.xml
@@ -6,8 +6,7 @@
 	xmlns:p="http://www.springframework.org/schema/p"
 	xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
 	   http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util.xsd"
-	default-init-method="initialize"
-	default-destroy-method="destroy">
+	default-init-method="initialize">
 
     <bean id="shibboleth.IdentifiableBeanPostProcessor"
         class="net.shibboleth.shared.spring.config.IdentifiableBeanPostProcessor" />
diff --git a/idp-saml-impl/src/test/resources/net/shibboleth/idp/saml/impl/profile/saml2Mapper.xml b/idp-saml-impl/src/test/resources/net/shibboleth/idp/saml/impl/profile/saml2Mapper.xml
index 0a840f457..5df92ad5d 100644
--- a/idp-saml-impl/src/test/resources/net/shibboleth/idp/saml/impl/profile/saml2Mapper.xml
+++ b/idp-saml-impl/src/test/resources/net/shibboleth/idp/saml/impl/profile/saml2Mapper.xml
@@ -6,8 +6,7 @@
     xmlns:p="http://www.springframework.org/schema/p"
     xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
        http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util.xsd"
-    default-init-method="initialize"
-    default-destroy-method="destroy">
+    default-init-method="initialize">
 
     <bean id="shibboleth.IdentifiableBeanPostProcessor"
         class="net.shibboleth.shared.spring.config.IdentifiableBeanPostProcessor" />
diff --git a/idp-session-impl/src/test/java/net/shibboleth/idp/session/impl/SessionManagerBaseTestCase.java b/idp-session-impl/src/test/java/net/shibboleth/idp/session/impl/SessionManagerBaseTestCase.java
index 49210c076..fa531ef61 100644
--- a/idp-session-impl/src/test/java/net/shibboleth/idp/session/impl/SessionManagerBaseTestCase.java
+++ b/idp-session-impl/src/test/java/net/shibboleth/idp/session/impl/SessionManagerBaseTestCase.java
@@ -22,6 +22,7 @@ import net.shibboleth.idp.session.SessionException;
 import net.shibboleth.shared.annotation.constraint.NotEmpty;
 import net.shibboleth.shared.component.ComponentInitializationException;
 import net.shibboleth.shared.net.CookieManager;
+import net.shibboleth.shared.primitive.AnnotationsSupport;
 import net.shibboleth.shared.security.IdentifierGenerationStrategy;
 import net.shibboleth.shared.security.IdentifierGenerationStrategy.ProviderType;
 import net.shibboleth.shared.servlet.impl.HttpServletRequestResponseContext;
@@ -79,8 +80,8 @@ public class SessionManagerBaseTestCase extends OpenSAMLInitBaseTestCase {
     }
     
     @AfterClass public void tearDown() {
-        sessionManager.destroy();
-        storageService.destroy();
+        AnnotationsSupport.callOnTeardownAnnotations(sessionManager);
+        AnnotationsSupport.callOnTeardownAnnotations(storageService);
     }
     
     /**

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


More information about the commits mailing list