[java-shib-shared] branch main updated: JSSH-5 - ServiceableComponent should implement AutoClose

Scott Cantor cantor.2 at osu.edu
Mon Nov 28 18:20:08 UTC 2022


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

scantor pushed a commit to branch main
in repository java-shib-shared.

View the commit online:
http://git.shibboleth.net/view/?p=java-shib-shared.git;a=commit;h=96c30f8a3b1f47b0e581ad92e471338ddacd212a

The following commit(s) were added to refs/heads/main by this push:
     new 96c30f8a JSSH-5 - ServiceableComponent should implement AutoClose
96c30f8a is described below

commit 96c30f8a3b1f47b0e581ad92e471338ddacd212a
Author: Scott Cantor <cantor.2 at osu.edu>
AuthorDate: Mon Nov 28 13:20:05 2022 -0500

    JSSH-5 - ServiceableComponent should implement AutoClose
    
    https://shibboleth.atlassian.net/browse/JSSH-5
    
    Mock component source now needs to throw on nulls.
---
 .../java/net/shibboleth/shared/testing/MockReloadableService.java   | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/shib-testing/src/main/java/net/shibboleth/shared/testing/MockReloadableService.java b/shib-testing/src/main/java/net/shibboleth/shared/testing/MockReloadableService.java
index bc583b89..44a473bd 100644
--- a/shib-testing/src/main/java/net/shibboleth/shared/testing/MockReloadableService.java
+++ b/shib-testing/src/main/java/net/shibboleth/shared/testing/MockReloadableService.java
@@ -17,9 +17,11 @@
 
 package net.shibboleth.shared.testing;
 
+import javax.annotation.Nonnull;
 import javax.annotation.Nullable;
 
 import net.shibboleth.shared.service.AbstractReloadableService;
+import net.shibboleth.shared.service.ServiceException;
 import net.shibboleth.shared.service.ServiceableComponent;
 import net.shibboleth.shared.spring.service.impl.SpringServiceableComponent;
 
@@ -48,9 +50,9 @@ public class MockReloadableService<T> extends AbstractReloadableService<T> {
 
     /** {@inheritDoc} */
     @Override
-    @Nullable public ServiceableComponent<T> getServiceableComponent() {
+    @Nonnull public ServiceableComponent<T> getServiceableComponent() {
         if (null == component) {
-            return null;
+            throw new ServiceException("Mock component is null");
         }
         assert(component != null);
         component.pinComponent();

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


More information about the commits mailing list