From c8a5d045bf605fdb6e1a7677993ae9b28f15bca5 Mon Sep 17 00:00:00 2001 From: Kerem Date: Tue, 16 Apr 2024 15:15:32 +0200 Subject: [PATCH] [java] display external build url on startup --- visual-java/src/main/java/com/saucelabs/visual/VisualApi.java | 2 +- visual-java/src/main/java/com/saucelabs/visual/VisualBuild.java | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/visual-java/src/main/java/com/saucelabs/visual/VisualApi.java b/visual-java/src/main/java/com/saucelabs/visual/VisualApi.java index ada3e318..8aa38114 100644 --- a/visual-java/src/main/java/com/saucelabs/visual/VisualApi.java +++ b/visual-java/src/main/java/com/saucelabs/visual/VisualApi.java @@ -202,7 +202,7 @@ private WebdriverSessionInfoQuery.Result webdriverSessionInfo() { * * @param url The url to the VisualBuild */ - private static String getStartupMessage(String url) { + static String getStartupMessage(String url) { StringBuilder sb = new StringBuilder(); sb.append("\n") .append("\n") diff --git a/visual-java/src/main/java/com/saucelabs/visual/VisualBuild.java b/visual-java/src/main/java/com/saucelabs/visual/VisualBuild.java index 1c4c2caf..98825b81 100644 --- a/visual-java/src/main/java/com/saucelabs/visual/VisualBuild.java +++ b/visual-java/src/main/java/com/saucelabs/visual/VisualBuild.java @@ -1,5 +1,6 @@ package com.saucelabs.visual; +import static com.saucelabs.visual.VisualApi.getStartupMessage; import static com.saucelabs.visual.utils.EnvironmentVariables.isNotBlank; import com.saucelabs.visual.VisualApi.BuildAttributes; @@ -66,6 +67,7 @@ public static VisualBuild getBuildOnce(VisualApi api, BuildAttributes buildAttri VisualBuild externalBuild = getExternalBuild(api); if (externalBuild != null) { build = externalBuild; + log.info(getStartupMessage(build.url)); } else { build = api.createBuild(buildAttributes); Runtime.getRuntime().addShutdownHook(new Thread(() -> api.finishBuild(build.id)));