[java-shib-metadata-new] 07/09: JSSH-5 ServiceableComponent should implement AutoClose
Ian Young
ian at iay.org.uk
Tue Oct 4 13:25:45 UTC 2022
This is an automated email from the git hooks/post-receive script.
iay pushed a commit to branch main
in repository java-shib-metadata-new.
View the commit online:
http://git.shibboleth.net/view/?p=java-shib-metadata-new.git;a=commit;h=15bfe9bafb5d4ec51f9d44439d50fff49217c26d
commit 15bfe9bafb5d4ec51f9d44439d50fff49217c26d
Author: Rod Widdowson <rdw at steadingsoftware.com>
AuthorDate: Thu Sep 29 14:33:11 2022 +0100
JSSH-5 ServiceableComponent should implement AutoClose
https://shibboleth.atlassian.net/browse/JSSH-5
Use auto close rather than manually unpinning things.
---
.../net/shibboleth/spring/metadata/InlineMetadataParserTest.java | 8 ++------
1 file changed, 2 insertions(+), 6 deletions(-)
diff --git a/shib-metadata-spring/src/test/java/net/shibboleth/spring/metadata/InlineMetadataParserTest.java b/shib-metadata-spring/src/test/java/net/shibboleth/spring/metadata/InlineMetadataParserTest.java
index 049c9a00..508b0975 100644
--- a/shib-metadata-spring/src/test/java/net/shibboleth/spring/metadata/InlineMetadataParserTest.java
+++ b/shib-metadata-spring/src/test/java/net/shibboleth/spring/metadata/InlineMetadataParserTest.java
@@ -115,16 +115,12 @@ public class InlineMetadataParserTest extends AbstractMetadataParserTest {
final ReloadableSpringService<MetadataResolver> ms =
context.getBean("shibboleth.MetadataResolverService", ReloadableSpringService.class);
- final ServiceableComponent<MetadataResolver> msc = ms.getServiceableComponent();
-
- try {
+ try (final ServiceableComponent<MetadataResolver> msc = ms.getServiceableComponent()){
final MetadataResolver resolver = msc.getComponent();
Assert.assertNotNull(resolver.resolveSingle(criteriaFor(IDP_ID)));
Assert.assertNotNull(resolver.resolveSingle(criteriaFor(SP_ID)));
- } finally {
- msc.unpinComponent();
}
- msc.unloadComponent();
+ ms.destroy();
}
}
\ 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