[java-identity-provider] branch main updated: IDP-2032 - Add version to .idpnew file names

Scott Cantor cantor.2 at osu.edu
Wed Apr 26 17:24:34 UTC 2023


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

scantor 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=2e426c183cc6d46e495a5929ff56306d36534dbe

The following commit(s) were added to refs/heads/main by this push:
     new 2e426c183 IDP-2032 - Add version to .idpnew file names
2e426c183 is described below

commit 2e426c183cc6d46e495a5929ff56306d36534dbe
Author: Scott Cantor <cantor.2 at osu.edu>
AuthorDate: Wed Apr 26 13:24:30 2023 -0400

    IDP-2032 - Add version to .idpnew file names
    
    https://shibboleth.atlassian.net/browse/IDP-2032
    
    Get periods out of version string.
    Fix test, apparently Version is non-null under Maven.
---
 .../java/net/shibboleth/idp/module/AbstractIdPModule.java    |  2 +-
 .../test/java/net/shibboleth/idp/module/IdPModuleTest.java   | 12 +++++++++++-
 2 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/idp-admin-api/src/main/java/net/shibboleth/idp/module/AbstractIdPModule.java b/idp-admin-api/src/main/java/net/shibboleth/idp/module/AbstractIdPModule.java
index 1a724c9e0..9f22e8339 100644
--- a/idp-admin-api/src/main/java/net/shibboleth/idp/module/AbstractIdPModule.java
+++ b/idp-admin-api/src/main/java/net/shibboleth/idp/module/AbstractIdPModule.java
@@ -85,7 +85,7 @@ public abstract class AbstractIdPModule implements IdPModule {
     public AbstractIdPModule() {
         moduleResources = CollectionSupport.emptyList();
         final String version = Version.getVersion();
-        idpNewExt = version != null ? IDPNEW_EXT_BASE + "-" + version : IDPNEW_EXT_BASE;
+        idpNewExt = version != null ? IDPNEW_EXT_BASE + "-" + version.replace(".", "") : IDPNEW_EXT_BASE;
     }
     
     /** {@inheritDoc} */
diff --git a/idp-admin-api/src/test/java/net/shibboleth/idp/module/IdPModuleTest.java b/idp-admin-api/src/test/java/net/shibboleth/idp/module/IdPModuleTest.java
index e7aa19656..9f92156af 100644
--- a/idp-admin-api/src/test/java/net/shibboleth/idp/module/IdPModuleTest.java
+++ b/idp-admin-api/src/test/java/net/shibboleth/idp/module/IdPModuleTest.java
@@ -56,6 +56,7 @@ import org.testng.annotations.Test;
 
 import com.google.common.io.ByteStreams;
 
+import net.shibboleth.idp.Version;
 import net.shibboleth.idp.module.IdPModule.ModuleResource;
 import net.shibboleth.shared.httpclient.HttpClientBuilder;
 import net.shibboleth.shared.testing.RepositorySupport;
@@ -292,7 +293,16 @@ public class IdPModuleTest {
         
         String vel = Files.readString(testHome.resolve("views/test.vm"));
         Assert.assertEquals(vel, VEL_OTHER_DATA);
-        vel = Files.readString(testHome.resolve("views/test.vm.idpnew"));
+        
+        // Adjust filename so works on both Eclipse and with Maven CLI.
+        final String ver = Version.getVersion();
+        final String idpNewExt;
+        if (ver != null) {
+            idpNewExt = AbstractIdPModule.IDPNEW_EXT_BASE + "-" + ver.replace(".", "");
+        } else {
+            idpNewExt = AbstractIdPModule.IDPNEW_EXT_BASE;
+        }
+        vel = Files.readString(testHome.resolve("views/test.vm" + idpNewExt));
         Assert.assertEquals(vel, VEL_DATA);
     }
     

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


More information about the commits mailing list