[java-metadata-aggregator] 01/03: Nullability

Ian Young ian at iay.org.uk
Thu Mar 23 17:23:31 UTC 2023


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

iay pushed a commit to branch main
in repository java-metadata-aggregator.

View the commit online:
http://git.shibboleth.net/view/?p=java-metadata-aggregator.git;a=commit;h=ef8682ccfc8025eeb9b1689b336683949e9a47d7

commit ef8682ccfc8025eeb9b1689b336683949e9a47d7
Author: Ian Young <ian at iay.org.uk>
AuthorDate: Thu Mar 23 16:25:16 2023 +0000

    Nullability
---
 .../src/test/java/net/shibboleth/metadata/BaseTest.java   |  2 +-
 .../metadata/dom/DOMResourceSourceStageTest.java          | 15 +++++++--------
 2 files changed, 8 insertions(+), 9 deletions(-)

diff --git a/mda-framework/src/test/java/net/shibboleth/metadata/BaseTest.java b/mda-framework/src/test/java/net/shibboleth/metadata/BaseTest.java
index 01fdd95..8e797df 100644
--- a/mda-framework/src/test/java/net/shibboleth/metadata/BaseTest.java
+++ b/mda-framework/src/test/java/net/shibboleth/metadata/BaseTest.java
@@ -107,7 +107,7 @@ public abstract class BaseTest {
      * @param resourcePath classpath path to the resource
      * @return the data file as a resource
      */
-    public Resource getClasspathResource(final String resourcePath) {
+    public @Nonnull Resource getClasspathResource(final String resourcePath) {
         return new ClassPathResource(simpleClassRelativeName(resourcePath), testingClass);
     }
 
diff --git a/mda-framework/src/test/java/net/shibboleth/metadata/dom/DOMResourceSourceStageTest.java b/mda-framework/src/test/java/net/shibboleth/metadata/dom/DOMResourceSourceStageTest.java
index da999f4..9a01141 100644
--- a/mda-framework/src/test/java/net/shibboleth/metadata/dom/DOMResourceSourceStageTest.java
+++ b/mda-framework/src/test/java/net/shibboleth/metadata/dom/DOMResourceSourceStageTest.java
@@ -23,32 +23,31 @@ import static org.mockito.Mockito.when;
 import java.io.IOException;
 import java.util.ArrayList;
 
+import javax.annotation.Nonnull;
+
 import org.springframework.core.io.ByteArrayResource;
 import org.springframework.core.io.Resource;
 import org.springframework.core.io.UrlResource;
 import org.testng.Assert;
-import org.testng.annotations.BeforeClass;
 import org.testng.annotations.Test;
 import org.w3c.dom.Element;
 
 import net.shibboleth.metadata.BaseTest;
 import net.shibboleth.metadata.Item;
 import net.shibboleth.metadata.pipeline.StageProcessingException;
+import net.shibboleth.shared.component.ComponentInitializationException;
 import net.shibboleth.shared.xml.impl.BasicParserPool;
 
 public class DOMResourceSourceStageTest extends BaseTest {
 
-    DOMResourceSourceStageTest() {
-        super(DOMResourceSourceStage.class);
-    }
-
-    BasicParserPool parserPool;
+    private final @Nonnull BasicParserPool parserPool;
     
-    @BeforeClass void initialize() throws Exception {
+    DOMResourceSourceStageTest() throws ComponentInitializationException {
+        super(DOMResourceSourceStage.class);
         parserPool = new BasicParserPool();
         parserPool.initialize();
     }
-    
+
     @Test public void testSuccessfulFetchAndParse() throws Exception {
         Resource mdResource = new ByteArrayResource("<test/>".getBytes("UTF-8"));
 

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


More information about the commits mailing list