2020import static org .junit .Assert .fail ;
2121
2222import com .google .common .collect .ImmutableSet ;
23+ import io .grpc .internal .testing .FlagResetRule ;
2324import java .net .InetSocketAddress ;
2425import java .net .SocketAddress ;
2526import java .net .URI ;
27+ import java .util .Arrays ;
2628import java .util .Collection ;
2729import java .util .Collections ;
30+ import org .junit .Before ;
31+ import org .junit .Rule ;
2832import org .junit .Test ;
2933import org .junit .runner .RunWith ;
30- import org .junit .runners .JUnit4 ;
34+ import org .junit .runners .Parameterized ;
35+ import org .junit .runners .Parameterized .Parameter ;
36+ import org .junit .runners .Parameterized .Parameters ;
3137
3238/** Unit tests for {@link ManagedChannelRegistry}. */
33- @ RunWith (JUnit4 .class )
39+ @ RunWith (Parameterized .class )
3440public class ManagedChannelRegistryTest {
3541 private String target = "testing123" ;
3642 private ChannelCredentials creds = new ChannelCredentials () {
@@ -40,6 +46,21 @@ public ChannelCredentials withoutBearerTokens() {
4046 }
4147 };
4248
49+ @ Rule public final FlagResetRule flagResetRule = new FlagResetRule ();
50+
51+ @ Parameters (name = "enableRfc3986UrisParam={0}" )
52+ public static Iterable <Object []> data () {
53+ return Arrays .asList (new Object [][] {{true }, {false }});
54+ }
55+
56+ @ Parameter public boolean enableRfc3986UrisParam ;
57+
58+ @ Before
59+ public void setUp () {
60+ flagResetRule .setFlagForTest (
61+ InternalFeatureFlags ::setRfc3986UrisEnabled , enableRfc3986UrisParam );
62+ }
63+
4364 @ Test
4465 public void register_unavailableProviderThrows () {
4566 ManagedChannelRegistry reg = new ManagedChannelRegistry ();
0 commit comments