@@ -385,38 +385,40 @@ public void testBeforeCommand() throws Exception {
385
385
386
386
if (throwsException ) {
387
387
assertThrows (AbruptExitException .class , () -> remoteModule .beforeCommand (env ));
388
- } else {
389
- remoteModule .beforeCommand (env );
390
- assertThat (Thread .interrupted ()).isFalse ();
391
-
392
- capabilitiesList .forEach (capabilities -> {
393
- if (!INACCESSIBLE_GRPC_REMOTE .equals (capabilities )) {
394
- assertThat (capabilities .getRequestCount ()).isEqualTo (1 );
395
- }
396
- });
397
- RemoteActionContextProvider actionContextProvider = remoteModule .getActionContextProvider ();
398
- assertThat (actionContextProvider ).isNotNull ();
399
- GrpcCacheClient grpcCacheClient = null ;
400
- GrpcRemoteExecutor grpcRemoteExecutor = null ;
401
- if (cacheCapabilities != null ) {
402
- assertThat (actionContextProvider .getRemoteCache ()).isNotNull ();
403
- assertThat (actionContextProvider .getRemoteCache ().getCacheCapabilities ()).isNotNull ();
404
- assertThat (actionContextProvider .getRemoteCache ().getCacheCapabilities ())
405
- .isEqualTo (cacheCapabilities );
406
- grpcCacheClient = (GrpcCacheClient ) actionContextProvider .getRemoteCache ().cacheProtocol ;
407
- assertCircuitBreakerInstance (grpcCacheClient .getRetrier ().getCircuitBreaker (), remoteOptions );
408
- } else {
409
- assertThat (actionContextProvider .getRemoteCache ()).isNull ();
410
- }
388
+ return ;
389
+ }
390
+ remoteModule .beforeCommand (env );
391
+ assertThat (Thread .interrupted ()).isFalse ();
411
392
412
- if (hasRemoteExecutionCapability ) {
413
- assertThat (actionContextProvider .getRemoteExecutionClient ()).isNotNull ();
414
- grpcRemoteExecutor = (GrpcRemoteExecutor ) actionContextProvider .getRemoteExecutionClient ();
415
- assertCircuitBreakerInstance (grpcRemoteExecutor .getRetrier ().getCircuitBreaker (), remoteOptions );
416
- } else {
417
- assertThat (actionContextProvider .getRemoteExecutionClient ()).isNull ();
393
+ capabilitiesList .forEach (capabilities -> {
394
+ if (!INACCESSIBLE_GRPC_REMOTE .equals (capabilities )) {
395
+ assertThat (capabilities .getRequestCount ()).isEqualTo (1 );
418
396
}
397
+ });
398
+
399
+ RemoteActionContextProvider actionContextProvider = remoteModule .getActionContextProvider ();
400
+ assertThat (actionContextProvider ).isNotNull ();
401
+ GrpcCacheClient grpcCacheClient ;
402
+ GrpcRemoteExecutor grpcRemoteExecutor ;
403
+ if (cacheCapabilities != null ) {
404
+ assertThat (actionContextProvider .getRemoteCache ()).isNotNull ();
405
+ assertThat (actionContextProvider .getRemoteCache ().getCacheCapabilities ()).isNotNull ();
406
+ assertThat (actionContextProvider .getRemoteCache ().getCacheCapabilities ())
407
+ .isEqualTo (cacheCapabilities );
408
+ grpcCacheClient = (GrpcCacheClient ) actionContextProvider .getRemoteCache ().cacheProtocol ;
409
+ assertCircuitBreakerInstance (grpcCacheClient .getRetrier ().getCircuitBreaker (), remoteOptions );
410
+ } else {
411
+ assertThat (actionContextProvider .getRemoteCache ()).isNull ();
419
412
}
413
+
414
+ if (hasRemoteExecutionCapability ) {
415
+ assertThat (actionContextProvider .getRemoteExecutionClient ()).isNotNull ();
416
+ grpcRemoteExecutor = (GrpcRemoteExecutor ) actionContextProvider .getRemoteExecutionClient ();
417
+ assertCircuitBreakerInstance (grpcRemoteExecutor .getRetrier ().getCircuitBreaker (), remoteOptions );
418
+ } else {
419
+ assertThat (actionContextProvider .getRemoteExecutionClient ()).isNull ();
420
+ }
421
+
420
422
} finally {
421
423
serverList .forEach (Server ::shutdownNow );
422
424
for (Server server : serverList ) {
@@ -433,8 +435,10 @@ public void testNetrc_netrcWithoutRemoteCache() throws Exception {
433
435
scratch .file (netrc , "machine foo.example.org login baruser password barpass" );
434
436
AuthAndTLSOptions authAndTLSOptions = Options .getDefaults (AuthAndTLSOptions .class );
435
437
RemoteOptions remoteOptions = Options .getDefaults (RemoteOptions .class );
438
+
436
439
Cache <URI , ImmutableMap <String , ImmutableList <String >>> credentialCache =
437
440
Caffeine .newBuilder ().build ();
441
+
438
442
Credentials credentials =
439
443
RemoteModule .createCredentials (
440
444
CredentialHelperEnvironment .newBuilder ()
0 commit comments