@@ -23,21 +23,26 @@ void beforeEach() {
2323
2424 @ Test
2525 void createsNewChannelsAsRequested () {
26- assertNotNull (this .channelRegistry .forAddress ("foo" , 1000 ));
26+ assertNotNull (this .channelRegistry .forPlaintextAddress ("foo" , 1000 ));
2727 }
2828
2929 @ Test
3030 void reusesChannelsForDuplicateRequests () {
31- Channel firstChannel = this .channelRegistry .forAddress ("foo" , 1000 );
32- assertSame (firstChannel , this .channelRegistry .forAddress ("foo" , 1000 ));
33- assertNotSame (firstChannel , this .channelRegistry .forAddress ("foo" , 1001 ));
34- assertNotSame (firstChannel , this .channelRegistry .forAddress ("bar" , 1000 ));
31+ Channel firstChannel = this .channelRegistry .forPlaintextAddress ("foo" , 1000 );
32+ assertSame (firstChannel , this .channelRegistry .forPlaintextAddress ("foo" , 1000 ));
33+ Channel firstChannelSecure = this .channelRegistry .forSecureAddress ("foo" , 1000 );
34+ assertSame (firstChannelSecure , this .channelRegistry .forSecureAddress ("foo" , 1000 ));
35+ assertNotSame (firstChannel , firstChannelSecure );
36+ assertNotSame (firstChannel , this .channelRegistry .forPlaintextAddress ("foo" , 1001 ));
37+ assertNotSame (firstChannel , this .channelRegistry .forPlaintextAddress ("foo" , 1001 ));
38+ assertNotSame (firstChannelSecure , this .channelRegistry .forSecureAddress ("bar" , 1000 ));
39+ assertNotSame (firstChannelSecure , this .channelRegistry .forSecureAddress ("bar" , 1000 ));
3540 }
3641
3742 @ Test
3843 void shutdownAllChannelsOnShutdown () {
39- ManagedChannel firstChannel = this .channelRegistry .forAddress ("foo" , 1000 );
40- ManagedChannel secondChannel = this .channelRegistry .forAddress ("foo" , 1002 );
44+ ManagedChannel firstChannel = this .channelRegistry .forPlaintextAddress ("foo" , 1000 );
45+ ManagedChannel secondChannel = this .channelRegistry .forSecureAddress ("foo" , 1002 );
4146 assertFalse (firstChannel .isShutdown ());
4247 assertFalse (secondChannel .isShutdown ());
4348 this .channelRegistry .shutdown ();
@@ -48,6 +53,7 @@ void shutdownAllChannelsOnShutdown() {
4853 @ Test
4954 void throwsIfNewChannelRequestedAfterShutdown () {
5055 this .channelRegistry .shutdown ();
51- assertThrows (AssertionError .class , () -> this .channelRegistry .forAddress ("foo" , 1000 ));
56+ assertThrows (AssertionError .class , () -> this .channelRegistry .forPlaintextAddress ("foo" , 1000 ));
57+ assertThrows (AssertionError .class , () -> this .channelRegistry .forSecureAddress ("foo" , 1000 ));
5258 }
5359}
0 commit comments