diff --git a/java/server/src/org/openqa/selenium/grid/data/NodeStatus.java b/java/server/src/org/openqa/selenium/grid/data/NodeStatus.java index 6647780adcadb..360a7370a4c31 100644 --- a/java/server/src/org/openqa/selenium/grid/data/NodeStatus.java +++ b/java/server/src/org/openqa/selenium/grid/data/NodeStatus.java @@ -83,7 +83,7 @@ public boolean hasCapacity(Capabilities caps) { return count > 0; } - public NodeId getNodeId() { + public NodeId getId() { return nodeId; } diff --git a/java/server/src/org/openqa/selenium/grid/distributor/AddNode.java b/java/server/src/org/openqa/selenium/grid/distributor/AddNode.java index 501f6dc27ccaa..8a4d326b5afb2 100644 --- a/java/server/src/org/openqa/selenium/grid/distributor/AddNode.java +++ b/java/server/src/org/openqa/selenium/grid/distributor/AddNode.java @@ -62,7 +62,7 @@ public HttpResponse execute(HttpRequest req) { Node node = new RemoteNode( tracer, httpFactory, - status.getNodeId(), + status.getId(), status.getUri(), registrationSecret, status.getSlots().stream().map(Slot::getStereotype).collect(Collectors.toSet())); diff --git a/java/server/src/org/openqa/selenium/grid/distributor/local/LocalDistributor.java b/java/server/src/org/openqa/selenium/grid/distributor/local/LocalDistributor.java index 7ad2d9baeb9a4..cc5c47a231cd1 100644 --- a/java/server/src/org/openqa/selenium/grid/distributor/local/LocalDistributor.java +++ b/java/server/src/org/openqa/selenium/grid/distributor/local/LocalDistributor.java @@ -145,7 +145,7 @@ private void refresh(NodeStatus status) { writeLock.lock(); try { Optional existingByNodeId = hosts.stream() - .filter(host -> host.getId().equals(status.getNodeId())) + .filter(host -> host.getId().equals(status.getId())) .findFirst(); if (existingByNodeId.isPresent()) { @@ -168,7 +168,7 @@ private void refresh(NodeStatus status) { Node node = new RemoteNode( tracer, clientFactory, - status.getNodeId(), + status.getId(), status.getUri(), registrationSecret, status.getSlots().stream().map(Slot::getStereotype).collect(Collectors.toSet())); diff --git a/java/server/src/org/openqa/selenium/grid/distributor/selector/DefaultSlotSelector.java b/java/server/src/org/openqa/selenium/grid/distributor/selector/DefaultSlotSelector.java index e0f4404747205..c7a0c5801474b 100644 --- a/java/server/src/org/openqa/selenium/grid/distributor/selector/DefaultSlotSelector.java +++ b/java/server/src/org/openqa/selenium/grid/distributor/selector/DefaultSlotSelector.java @@ -58,7 +58,7 @@ public Set selectSlot(Capabilities capabilities, Set nodes) // Then last session created (oldest first), so natural ordering again .thenComparingLong(NodeStatus::getLastSessionCreated) // And use the node id as a tie-breaker. - .thenComparing(NodeStatus::getNodeId)) + .thenComparing(NodeStatus::getId)) .flatMap(node -> node.getSlots().stream() .filter(slot -> !slot.getSession().isPresent()) .filter(slot -> slot.isSupporting(capabilities)) diff --git a/java/server/test/org/openqa/selenium/grid/distributor/AddingNodesTest.java b/java/server/test/org/openqa/selenium/grid/distributor/AddingNodesTest.java index 977a918fb9259..2b63afff6478e 100644 --- a/java/server/test/org/openqa/selenium/grid/distributor/AddingNodesTest.java +++ b/java/server/test/org/openqa/selenium/grid/distributor/AddingNodesTest.java @@ -204,12 +204,12 @@ public void distributorShouldUpdateStateOfExistingNodeWhenNodePublishesStateChan // Craft a status that makes it look like the node is busy, and post it on the bus. NodeStatus status = node.getStatus(); NodeStatus crafted = new NodeStatus( - status.getNodeId(), + status.getId(), status.getUri(), status.getMaxSessionCount(), ImmutableSet.of( new Slot( - new SlotId(status.getNodeId(), UUID.randomUUID()), + new SlotId(status.getId(), UUID.randomUUID()), CAPS, Instant.now(), Optional.of(new Session(new SessionId(UUID.randomUUID()), sessionUri, CAPS, CAPS, Instant.now())))),