@@ -66,7 +66,7 @@ public void canConfigureNodeWithDriverDetection() {
66
66
List <Capabilities > reported = new ArrayList <>();
67
67
new NodeOptions (config ).getSessionFactories (caps -> {
68
68
reported .add (caps );
69
- return Collections .emptySet ( );
69
+ return Collections .singleton ( HelperFactory . create ( config , caps ) );
70
70
});
71
71
72
72
ChromeDriverInfo chromeDriverInfo = new ChromeDriverInfo ();
@@ -90,7 +90,7 @@ public void shouldDetectCorrectDriversOnWindows() {
90
90
List <Capabilities > reported = new ArrayList <>();
91
91
new NodeOptions (config ).getSessionFactories (caps -> {
92
92
reported .add (caps );
93
- return Collections .emptySet ( );
93
+ return Collections .singleton ( HelperFactory . create ( config , caps ) );
94
94
});
95
95
96
96
assertThat (reported ).is (supporting ("chrome" ));
@@ -112,7 +112,7 @@ public void shouldDetectCorrectDriversOnMac() {
112
112
List <Capabilities > reported = new ArrayList <>();
113
113
new NodeOptions (config ).getSessionFactories (caps -> {
114
114
reported .add (caps );
115
- return Collections .emptySet ( );
115
+ return Collections .singleton ( HelperFactory . create ( config , caps ) );
116
116
});
117
117
118
118
// There may be more drivers available, but we know that these are meant to be here.
@@ -126,7 +126,7 @@ public void canConfigureNodeWithoutDriverDetection() {
126
126
List <Capabilities > reported = new ArrayList <>();
127
127
new NodeOptions (config ).getSessionFactories (caps -> {
128
128
reported .add (caps );
129
- return Collections .emptySet ( );
129
+ return Collections .singleton ( HelperFactory . create ( config , caps ) );
130
130
});
131
131
132
132
assertThat (reported ).isEmpty ();
@@ -144,7 +144,7 @@ public void shouldThrowConfigExceptionIfDetectDriversIsFalseAndSpecificDriverIsA
144
144
try {
145
145
new NodeOptions (config ).getSessionFactories (caps -> {
146
146
reported .add (caps );
147
- return Collections .emptySet ( );
147
+ return Collections .singleton ( HelperFactory . create ( config , caps ) );
148
148
});
149
149
fail ("Should have not executed 'getSessionFactories' successfully" );
150
150
} catch (ConfigException e ) {
@@ -161,7 +161,7 @@ public void detectDriversByDefault() {
161
161
List <Capabilities > reported = new ArrayList <>();
162
162
new NodeOptions (config ).getSessionFactories (caps -> {
163
163
reported .add (caps );
164
- return Collections .emptySet ( );
164
+ return Collections .singleton ( HelperFactory . create ( config , caps ) );
165
165
});
166
166
167
167
assertThat (reported ).isNotEmpty ();
@@ -221,7 +221,7 @@ public void driversCanBeConfigured() {
221
221
List <Capabilities > reported = new ArrayList <>();
222
222
new NodeOptions (config ).getSessionFactories (capabilities -> {
223
223
reported .add (capabilities );
224
- return Collections .emptySet ( );
224
+ return Collections .singleton ( HelperFactory . create ( config , capabilities ) );
225
225
});
226
226
227
227
assertThat (reported ).is (supporting ("chrome" ));
@@ -269,7 +269,7 @@ public void driversConfigNeedsStereotypeField() {
269
269
try {
270
270
new NodeOptions (config ).getSessionFactories (caps -> {
271
271
reported .add (caps );
272
- return Collections .emptySet ( );
272
+ return Collections .singleton ( HelperFactory . create ( config , caps ) );
273
273
});
274
274
fail ("Should have not executed 'getSessionFactories' successfully because driver config " +
275
275
"needs the stereotype field" );
@@ -288,7 +288,6 @@ private Condition<? super List<? extends Capabilities>> supporting(String name)
288
288
}
289
289
290
290
public static class HelperFactory {
291
-
292
291
public static SessionFactory create (Config config , Capabilities caps ) {
293
292
return new SessionFactory () {
294
293
@ Override
0 commit comments