4242import org .openqa .selenium .ImmutableCapabilities ;
4343import org .openqa .selenium .events .EventBus ;
4444import org .openqa .selenium .events .local .GuavaEventBus ;
45+ import org .openqa .selenium .grid .data .DefaultSlotMatcher ;
4546import org .openqa .selenium .grid .data .NodeId ;
4647import org .openqa .selenium .grid .data .NodeStatus ;
4748import org .openqa .selenium .grid .data .Session ;
@@ -99,7 +100,7 @@ void nodesAreOrderedNodesByNumberOfSupportedBrowsers() {
99100 nodes .add (twoBrowsers );
100101 nodes .add (oneBrowser );
101102
102- Set <SlotId > slots = selector .selectSlot (caps , nodes );
103+ Set <SlotId > slots = selector .selectSlot (caps , nodes , new DefaultSlotMatcher () );
103104
104105 ImmutableSet <NodeId > nodeIds =
105106 slots .stream ().map (SlotId ::getOwningNodeId ).distinct ().collect (toImmutableSet ());
@@ -123,7 +124,9 @@ void theMostLightlyLoadedNodeIsSelectedFirst() {
123124 NodeStatus heavy = createNode (Collections .singletonList (caps ), 10 , 6 );
124125 NodeStatus massive = createNode (Collections .singletonList (caps ), 10 , 8 );
125126
126- Set <SlotId > ids = selector .selectSlot (caps , ImmutableSet .of (heavy , medium , lightest , massive ));
127+ Set <SlotId > ids =
128+ selector .selectSlot (
129+ caps , ImmutableSet .of (heavy , medium , lightest , massive ), new DefaultSlotMatcher ());
127130 SlotId expected = ids .iterator ().next ();
128131
129132 assertThat (lightest .getSlots ().stream ()).anyMatch (slot -> expected .equals (slot .getId ()));
@@ -138,7 +141,8 @@ void theNodeWhichHasExceededMaxSessionsIsNotSelected() {
138141 NodeStatus maximumLoad = createNode (ImmutableList .of (chrome ), 12 , 12 );
139142
140143 Set <SlotId > ids =
141- selector .selectSlot (chrome , ImmutableSet .of (maximumLoad , mediumLoad , lightLoad ));
144+ selector .selectSlot (
145+ chrome , ImmutableSet .of (maximumLoad , mediumLoad , lightLoad ), new DefaultSlotMatcher ());
142146 SlotId expected = ids .iterator ().next ();
143147
144148 // The slot should belong to the Node with light load
@@ -172,7 +176,8 @@ void nodesAreOrderedByNumberOfSupportedBrowsersAndLoad() {
172176 lightLoadAndThreeBrowsers ,
173177 mediumLoadAndTwoBrowsers ,
174178 mediumLoadAndOtherTwoBrowsers ,
175- highLoadAndOneBrowser ));
179+ highLoadAndOneBrowser ),
180+ new DefaultSlotMatcher ());
176181
177182 // The slot should belong to the Node with high load because it only supports Chrome, leaving
178183 // the other Nodes with more availability for other browsers
0 commit comments