20
20
import com .google .common .annotations .VisibleForTesting ;
21
21
import com .google .common .collect .ImmutableMap ;
22
22
import com .google .common .collect .ImmutableSet ;
23
- import dev .failsafe .Failsafe ;
24
- import dev .failsafe .RetryPolicy ;
23
+
25
24
import org .openqa .selenium .Beta ;
26
25
import org .openqa .selenium .Capabilities ;
27
26
import org .openqa .selenium .HealthCheckFailedException ;
81
80
import org .openqa .selenium .remote .tracing .Tracer ;
82
81
import org .openqa .selenium .status .HasReadyState ;
83
82
83
+ import dev .failsafe .Failsafe ;
84
+ import dev .failsafe .RetryPolicy ;
85
+
84
86
import java .io .Closeable ;
85
87
import java .io .UncheckedIOException ;
86
88
import java .net .URI ;
@@ -493,21 +495,25 @@ public Either<SessionNotCreatedException, CreateSessionResponse> newSession(Sess
493
495
Map <String , EventAttributeValue > attributeMap = new HashMap <>();
494
496
try {
495
497
attributeMap .put (AttributeKey .LOGGER_CLASS .getKey (),
496
- EventAttribute .setValue (getClass ().getName ()));
498
+ EventAttribute .setValue (getClass ().getName ()));
497
499
498
- attributeMap .put ("request.payload" , EventAttribute .setValue (request .getDesiredCapabilities ().toString ()));
500
+ attributeMap .put ("request.payload" ,
501
+ EventAttribute .setValue (request .getDesiredCapabilities ().toString ()));
499
502
String sessionReceivedMessage = "Session request received by the Distributor" ;
500
503
span .addEvent (sessionReceivedMessage , attributeMap );
501
- LOG .info (String .format ("%s: \n %s" , sessionReceivedMessage , request .getDesiredCapabilities ()));
504
+ LOG .info (String .format ("%s: %n %s" ,
505
+ sessionReceivedMessage ,
506
+ request .getDesiredCapabilities ()));
502
507
503
508
// If there are no capabilities at all, something is horribly wrong
504
509
if (request .getDesiredCapabilities ().isEmpty ()) {
505
510
SessionNotCreatedException exception =
506
511
new SessionNotCreatedException ("No capabilities found in session request payload" );
507
512
EXCEPTION .accept (attributeMap , exception );
508
513
attributeMap .put (AttributeKey .EXCEPTION_MESSAGE .getKey (),
509
- EventAttribute .setValue ("Unable to create session. No capabilities found: " +
510
- exception .getMessage ()));
514
+ EventAttribute .setValue (
515
+ "Unable to create session. No capabilities found: " +
516
+ exception .getMessage ()));
511
517
span .addEvent (AttributeKey .EXCEPTION_EVENT .getKey (), attributeMap );
512
518
return Either .left (exception );
513
519
}
@@ -528,7 +534,7 @@ public Either<SessionNotCreatedException, CreateSessionResponse> newSession(Sess
528
534
SlotId selectedSlot = reserveSlot (request .getRequestId (), caps );
529
535
if (selectedSlot == null ) {
530
536
LOG .info (
531
- String .format ("Unable to find a free slot for request %s. \ n %s " ,
537
+ String .format ("Unable to find a free slot for request %s. % n %s " ,
532
538
request .getRequestId (),
533
539
caps ));
534
540
retry = true ;
@@ -558,7 +564,7 @@ public Either<SessionNotCreatedException, CreateSessionResponse> newSession(Sess
558
564
String sessionCreatedMessage = "Session created by the Distributor" ;
559
565
span .addEvent (sessionCreatedMessage , attributeMap );
560
566
LOG .info (
561
- String .format ("%s. Id: %s \ n Caps: %s" , sessionCreatedMessage , sessionId , sessionCaps ));
567
+ String .format ("%s. Id: %s % n Caps: %s" , sessionCreatedMessage , sessionId , sessionCaps ));
562
568
563
569
return Either .right (response );
564
570
} catch (SessionNotCreatedException e ) {
0 commit comments