From a72047270c2e9acfed35ccaf13015ae44e8f1548 Mon Sep 17 00:00:00 2001 From: Andrei Kamarouski Date: Thu, 25 Jan 2024 13:38:35 +0100 Subject: [PATCH] refactor(MobileRemoteProxy): modify 'Node is down' logs --- .../com/zebrunner/mcloud/grid/MobileRemoteProxy.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/zebrunner/mcloud/grid/MobileRemoteProxy.java b/src/main/java/com/zebrunner/mcloud/grid/MobileRemoteProxy.java index d6d7007..d6f8408 100644 --- a/src/main/java/com/zebrunner/mcloud/grid/MobileRemoteProxy.java +++ b/src/main/java/com/zebrunner/mcloud/grid/MobileRemoteProxy.java @@ -73,7 +73,9 @@ public TestSession getNewSession(Map requestedCapability) { getTestSlots().stream() .findAny() .ifPresent((slot -> { - LOGGER.info(() -> String.format("Node is down: '%s:%s' - '%s (%s)'", + LOGGER.info(() -> String.format("Node is down: '[%s]-'%s:%s' (%s)'", + CapabilityUtils.getAppiumCapability(slot.getCapabilities(), "deviceName") + .orElse(StringUtils.EMPTY), Optional.of(slot) .map(TestSlot::getProxy) .map(RemoteProxy::getRemoteHost) @@ -85,8 +87,9 @@ public TestSession getNewSession(Map requestedCapability) { .map(URL::getPort) .map(String::valueOf) .orElse(StringUtils.EMPTY), - CapabilityUtils.getAppiumCapability(slot.getCapabilities(), "udid"), - CapabilityUtils.getAppiumCapability(slot.getCapabilities(), "deviceName")) + CapabilityUtils.getAppiumCapability(slot.getCapabilities(), "udid") + .orElse(StringUtils.EMPTY) + ) ); })); return null;