[java-idp-integration-tests] 02/10: Cleanup - move utilities to util package
Tom Zeller
tzeller at dragonacea.biz
Wed Aug 28 22:38:30 UTC 2024
This is an automated email from the git hooks/post-receive script.
tzeller pushed a commit to branch main
in repository java-idp-integration-tests.
View the commit online:
http://git.shibboleth.net/view/?p=java-idp-integration-tests.git;a=commit;h=371ed840d47fffb4741937ffd40dff9e4f5ca721
commit 371ed840d47fffb4741937ffd40dff9e4f5ca721
Author: Tom Zeller <tzeller at dragonacea.biz>
AuthorDate: Tue Aug 27 22:51:34 2024 -0500
Cleanup - move utilities to util package
---
.../idp/integration/tests/BaseIntegrationTest.java | 11 +++--
.../tests/{ => util}/Route53Helper.java | 54 +++++++++++++---------
.../{ => util/server}/AbstractServerProcess.java | 3 +-
.../{ => util/server}/JettyServerProcess.java | 2 +-
.../{ => util/server}/TomcatServerProcess.java | 3 +-
.../tests/{ => util/testng}/TestNameLogger.java | 2 +-
6 files changed, 46 insertions(+), 29 deletions(-)
diff --git a/src/test/java/net/shibboleth/idp/integration/tests/BaseIntegrationTest.java b/src/test/java/net/shibboleth/idp/integration/tests/BaseIntegrationTest.java
index 71352ce..de89b67 100644
--- a/src/test/java/net/shibboleth/idp/integration/tests/BaseIntegrationTest.java
+++ b/src/test/java/net/shibboleth/idp/integration/tests/BaseIntegrationTest.java
@@ -108,6 +108,11 @@ import org.testng.annotations.DataProvider;
import org.testng.annotations.Listeners;
import net.shibboleth.idp.installer.PropertiesWithComments;
+import net.shibboleth.idp.integration.tests.util.Route53Helper;
+import net.shibboleth.idp.integration.tests.util.server.AbstractServerProcess;
+import net.shibboleth.idp.integration.tests.util.server.JettyServerProcess;
+import net.shibboleth.idp.integration.tests.util.server.TomcatServerProcess;
+import net.shibboleth.idp.integration.tests.util.testng.TestNameLogger;
import net.shibboleth.shared.annotation.constraint.NonnullAfterInit;
import net.shibboleth.shared.annotation.constraint.NotEmpty;
import net.shibboleth.shared.component.ComponentInitializationException;
@@ -826,7 +831,7 @@ public abstract class BaseIntegrationTest {
final URLBuilder urlBuilder = new URLBuilder();
urlBuilder.setScheme("http");
if (Boolean.getBoolean("DNS")) {
- urlBuilder.setHost(route53.name);
+ urlBuilder.setHost(route53.getName());
} else {
urlBuilder.setHost(hostname);
}
@@ -838,7 +843,7 @@ public abstract class BaseIntegrationTest {
final URLBuilder secureUrlBuilder = new URLBuilder();
secureUrlBuilder.setScheme("https");
if (Boolean.getBoolean("DNS")) {
- secureUrlBuilder.setHost(route53.name);
+ secureUrlBuilder.setHost(route53.getName());
} else {
secureUrlBuilder.setHost(hostname);
}
@@ -1488,7 +1493,7 @@ public abstract class BaseIntegrationTest {
throw new RuntimeException(e);
}
}
- addresses.add(route53.name);
+ addresses.add(route53.getName());
}
for (final String addr : addresses) {
if (addr == "localhost") {
diff --git a/src/test/java/net/shibboleth/idp/integration/tests/Route53Helper.java b/src/test/java/net/shibboleth/idp/integration/tests/util/Route53Helper.java
similarity index 98%
rename from src/test/java/net/shibboleth/idp/integration/tests/Route53Helper.java
rename to src/test/java/net/shibboleth/idp/integration/tests/util/Route53Helper.java
index 2f5d92b..bd3f8f4 100644
--- a/src/test/java/net/shibboleth/idp/integration/tests/Route53Helper.java
+++ b/src/test/java/net/shibboleth/idp/integration/tests/util/Route53Helper.java
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-package net.shibboleth.idp.integration.tests;
+package net.shibboleth.idp.integration.tests.util;
import java.io.BufferedReader;
import java.io.IOException;
@@ -382,6 +382,27 @@ public class Route53Helper extends AbstractInitializableComponent implements Aut
return changeResourceRecordSetsResponse;
}
+ /**
+ * Get hosted zone id for the {@link #domain} or null if not found.
+ *
+ * @return hosted zone id for the {@link #domain} or null
+ */
+ @Nullable
+ public String getAWSHostedZoneId() {
+
+ final ListHostedZonesRequest request = ListHostedZonesRequest.builder().build();
+
+ final ListHostedZonesResponse response = route53Client.listHostedZones(request);
+
+ for (final HostedZone hostedZone : response.hostedZones()) {
+ if (hostedZone.name().equalsIgnoreCase(domain)) {
+ return hostedZone.id();
+ }
+ }
+
+ return null;
+ }
+
/**
* Get fully qualified domain name from the given IP address.
*
@@ -403,6 +424,16 @@ public class Route53Helper extends AbstractInitializableComponent implements Aut
return fqdn.replaceAll(".$", "");
}
+ /**
+ * Get host name for DNS A record.
+ *
+ * @return host name for DNS A record
+ */
+ @Nonnull
+ public String getName() {
+ return name;
+ }
+
/**
* Get public IP address by sending request to http://checkip.amazonaws.com/
*
@@ -434,27 +465,6 @@ public class Route53Helper extends AbstractInitializableComponent implements Aut
}
}
- /**
- * Get hosted zone id for the {@link #domain} or null if not found.
- *
- * @return hosted zone id for the {@link #domain} or null
- */
- @Nullable
- public String getAWSHostedZoneId() {
-
- final ListHostedZonesRequest request = ListHostedZonesRequest.builder().build();
-
- final ListHostedZonesResponse response = route53Client.listHostedZones(request);
-
- for (final HostedZone hostedZone : response.hostedZones()) {
- if (hostedZone.name().equalsIgnoreCase(domain)) {
- return hostedZone.id();
- }
- }
-
- return null;
- }
-
/**
* Whether change is in sync
*
diff --git a/src/test/java/net/shibboleth/idp/integration/tests/AbstractServerProcess.java b/src/test/java/net/shibboleth/idp/integration/tests/util/server/AbstractServerProcess.java
similarity index 99%
rename from src/test/java/net/shibboleth/idp/integration/tests/AbstractServerProcess.java
rename to src/test/java/net/shibboleth/idp/integration/tests/util/server/AbstractServerProcess.java
index 3c86a34..318a1db 100644
--- a/src/test/java/net/shibboleth/idp/integration/tests/AbstractServerProcess.java
+++ b/src/test/java/net/shibboleth/idp/integration/tests/util/server/AbstractServerProcess.java
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-package net.shibboleth.idp.integration.tests;
+package net.shibboleth.idp.integration.tests.util.server;
import java.io.File;
import java.io.IOException;
@@ -50,6 +50,7 @@ import org.springframework.context.Lifecycle;
import com.google.common.base.Stopwatch;
+import net.shibboleth.idp.integration.tests.StatusTest;
import net.shibboleth.shared.annotation.constraint.Live;
import net.shibboleth.shared.annotation.constraint.NonnullAfterInit;
import net.shibboleth.shared.annotation.constraint.NotEmpty;
diff --git a/src/test/java/net/shibboleth/idp/integration/tests/JettyServerProcess.java b/src/test/java/net/shibboleth/idp/integration/tests/util/server/JettyServerProcess.java
similarity index 98%
rename from src/test/java/net/shibboleth/idp/integration/tests/JettyServerProcess.java
rename to src/test/java/net/shibboleth/idp/integration/tests/util/server/JettyServerProcess.java
index e633ccd..34597f4 100644
--- a/src/test/java/net/shibboleth/idp/integration/tests/JettyServerProcess.java
+++ b/src/test/java/net/shibboleth/idp/integration/tests/util/server/JettyServerProcess.java
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-package net.shibboleth.idp.integration.tests;
+package net.shibboleth.idp.integration.tests.util.server;
import java.io.InputStreamReader;
import java.io.LineNumberReader;
diff --git a/src/test/java/net/shibboleth/idp/integration/tests/TomcatServerProcess.java b/src/test/java/net/shibboleth/idp/integration/tests/util/server/TomcatServerProcess.java
similarity index 97%
rename from src/test/java/net/shibboleth/idp/integration/tests/TomcatServerProcess.java
rename to src/test/java/net/shibboleth/idp/integration/tests/util/server/TomcatServerProcess.java
index a26df82..d35a00b 100644
--- a/src/test/java/net/shibboleth/idp/integration/tests/TomcatServerProcess.java
+++ b/src/test/java/net/shibboleth/idp/integration/tests/util/server/TomcatServerProcess.java
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-package net.shibboleth.idp.integration.tests;
+package net.shibboleth.idp.integration.tests.util.server;
import java.io.IOException;
import java.nio.file.Path;
@@ -29,6 +29,7 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.testng.Assert;
+import net.shibboleth.idp.integration.tests.BaseIntegrationTest;
import net.shibboleth.shared.component.ComponentInitializationException;
import net.shibboleth.shared.logic.Constraint;
diff --git a/src/test/java/net/shibboleth/idp/integration/tests/TestNameLogger.java b/src/test/java/net/shibboleth/idp/integration/tests/util/testng/TestNameLogger.java
similarity index 97%
rename from src/test/java/net/shibboleth/idp/integration/tests/TestNameLogger.java
rename to src/test/java/net/shibboleth/idp/integration/tests/util/testng/TestNameLogger.java
index ccb2e98..c230a41 100644
--- a/src/test/java/net/shibboleth/idp/integration/tests/TestNameLogger.java
+++ b/src/test/java/net/shibboleth/idp/integration/tests/util/testng/TestNameLogger.java
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-package net.shibboleth.idp.integration.tests;
+package net.shibboleth.idp.integration.tests.util.testng;
import javax.annotation.Nonnull;
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the commits
mailing list