Class ExternalUrlReachabilityTest

java.lang.Object
ubic.gemma.core.util.test.ExternalUrlReachabilityTest

@Tag("network") public class ExternalUrlReachabilityTest extends Object
Out-of-band reachability probe for every external URL Gemma talks to.

This test is tagged @Tag("network") so it is excluded from the default mvn verify pass (the parent pom.xml adds network to surefire's excludedGroups). It is intended to be invoked explicitly, e.g. from a nightly CI job or ad hoc by a developer chasing a loader regression caused by an upstream endpoint move.

How to run

mvn -pl gemma-core test -Dtest=ExternalUrlReachabilityTest -DexcludedGroups=
Override of excludedGroups clears the network exclusion injected by the parent pom so this single test fires. (The default -DexcludedGroups=integration,network would skip it.)

Output

Writes a structured JSON report to gemma-core/target/external-url-reachability.json. The schema is intentionally flat so an ops dashboard or CI artifact can consume it directly:
{
  "timestamp": "2026-05-21T11:34:56Z",
  "totalCount": 28, "okCount": 25, "failCount": 3,
  "results": [
    {"label": "...", "category": "...", "url": "...", "ok": true,  "status": 200, "elapsedMs": 412},
    {"label": "...", "category": "...", "url": "...", "ok": false, "status": -1,  "elapsedMs": 5012, "error": "ConnectException: ..."}
  ]
}

Failure behaviour

  • If all URLs fail the test SKIPS (via Assumptions.assumeTrue(boolean)) — the host's network is probably down and the result would be uninformative.
  • If some URLs fail the test PASSES — the JSON dashboard alerts on per-URL drift.

Adding a new endpoint

Append an ExternalUrlReachabilityTest.Endpoint to ENDPOINTS. Pick a meaningful label (used by the dashboard); set ftp=true for plain ftp:// URLs so the probe uses FTPClient instead of HTTP.
  • Constructor Details

    • ExternalUrlReachabilityTest

      public ExternalUrlReachabilityTest()