File tree Expand file tree Collapse file tree 2 files changed +18
-0
lines changed
Expand file tree Collapse file tree 2 files changed +18
-0
lines changed Original file line number Diff line number Diff line change 2323import com .google .common .base .Objects ;
2424import com .google .common .base .Preconditions ;
2525import java .util .ArrayList ;
26+ import java .util .Arrays ;
2627import java .util .Collections ;
2728import java .util .List ;
2829import java .util .Map ;
@@ -738,6 +739,7 @@ public String toString() {
738739 .add ("addrs" , addrs )
739740 .add ("attrs" , attrs )
740741 .add ("listener" , stateListener )
742+ .add ("customOptions" , Arrays .deepToString (customOptions ))
741743 .toString ();
742744 }
743745
Original file line number Diff line number Diff line change @@ -268,6 +268,22 @@ public void createSubchannelArgs_option_lastOneWins() {
268268 assertThat (args .getOption (testKey )).isEqualTo (testValue2 );
269269 }
270270
271+ @ Test
272+ public void createSubchannelArgs_toString () {
273+ CreateSubchannelArgs .Key <String > testKey = CreateSubchannelArgs .Key .create ("test-key" );
274+ CreateSubchannelArgs args = CreateSubchannelArgs .newBuilder ()
275+ .setAddresses (eag )
276+ .setAttributes (attrs )
277+ .setStateListener (subchannelStateListener )
278+ .addOption (testKey , "test-value" )
279+ .build ();
280+ String str = args .toString ();
281+ assertThat (str ).contains ("addrs=" );
282+ assertThat (str ).contains ("attrs=" );
283+ assertThat (str ).contains ("listener=" );
284+ assertThat (str ).contains ("customOptions=" );
285+ }
286+
271287 @ Deprecated
272288 @ Test
273289 public void handleResolvedAddressGroups_delegatesToHandleResolvedAddresses () {
You can’t perform that action at this time.
0 commit comments