[java-identity-provider] branch main updated: Skip tests when idp.properties exists

Tom Zeller tzeller at dragonacea.biz
Thu May 26 00:13:59 UTC 2022


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

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

View the commit online:
http://git.shibboleth.net/view/?p=java-identity-provider.git;a=commit;h=de71f27193334f22c4f4618b3f2166b0e85a3b6b

The following commit(s) were added to refs/heads/main by this push:
     new de71f2719 Skip tests when idp.properties exists
de71f2719 is described below

commit de71f27193334f22c4f4618b3f2166b0e85a3b6b
Author: Tom Zeller <tzeller at dragonacea.biz>
AuthorDate: Wed May 25 19:13:48 2022 -0500

    Skip tests when idp.properties exists
    
    Skip tests which assert that exceptions are thrown when
    /opt/shibboleth-idp/conf/idp.properties does not exist when the IdP is
    installed to the default location.
    
    Throw SkipException which will report that tests were skipped rather
    than failures.
    
    https://shibboleth.atlassian.net/browse/IDP-1937
---
 .../IdPPropertiesApplicationContextInitializerTest.java       | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/idp-conf/src/test/java/net/shibboleth/idp/test/spring/IdPPropertiesApplicationContextInitializerTest.java b/idp-conf/src/test/java/net/shibboleth/idp/test/spring/IdPPropertiesApplicationContextInitializerTest.java
index 57376162f..1f7c846f1 100644
--- a/idp-conf/src/test/java/net/shibboleth/idp/test/spring/IdPPropertiesApplicationContextInitializerTest.java
+++ b/idp-conf/src/test/java/net/shibboleth/idp/test/spring/IdPPropertiesApplicationContextInitializerTest.java
@@ -29,6 +29,7 @@ import org.springframework.web.context.ContextLoaderListener;
 import org.springframework.web.context.WebApplicationContext;
 import org.springframework.web.context.support.WebApplicationContextUtils;
 import org.testng.Assert;
+import org.testng.SkipException;
 import org.testng.annotations.BeforeMethod;
 import org.testng.annotations.Test;
 
@@ -60,15 +61,17 @@ public class IdPPropertiesApplicationContextInitializerTest {
     }
 
     @Test(expectedExceptions = ConstraintViolationException.class) public void testNotFound() {
-        Assert.assertFalse(Files.exists(Paths.get("/opt", "shibboleth-idp", "conf", "idp.properties")),
-                "File /opt/shibboleth-idp/conf/idp.properties should not exist");
+        if (Files.exists(Paths.get("/opt", "shibboleth-idp", "conf", "idp.properties"))) {
+           throw new SkipException("Skipping test because /opt/shibboleth-idp/conf/idp.properties exists");
+        }
         listener.contextInitialized(new ServletContextEvent(sc));
         WebApplicationContextUtils.getRequiredWebApplicationContext(sc);
     }
 
     @Test(expectedExceptions = {BeanDefinitionStoreException.class}) public void testNotFoundFalseFailFast() {
-        Assert.assertFalse(Files.exists(Paths.get("/opt", "shibboleth-idp", "conf", "idp.properties")),
-                "File /opt/shibboleth-idp/conf/idp.properties should not exist");
+        if (Files.exists(Paths.get("/opt", "shibboleth-idp", "conf", "idp.properties"))) {
+            throw new SkipException("Skipping test because /opt/shibboleth-idp/conf/idp.properties exists");
+        }
         sc.addInitParameter("idp.initializer.failFast", "false");
         listener.contextInitialized(new ServletContextEvent(sc));
         WebApplicationContextUtils.getRequiredWebApplicationContext(sc);

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


More information about the commits mailing list