77
88package com .salesforce .grpc .contrib ;
99
10- import io .grpc .Attributes ;
1110import io .grpc .NameResolver ;
1211import io .grpc .NameResolverProvider ;
1312import org .junit .Test ;
1817
1918@ SuppressWarnings ("ALL" )
2019public class FallbackResolverTest {
20+
21+ private final NameResolverFakes fakes = new NameResolverFakes ();
2122 @ Test
2223 public void firstShouldFind () throws Exception {
2324 NameResolver fakeResolver = new FakeResolver ();
@@ -26,7 +27,7 @@ public void firstShouldFind() throws Exception {
2627
2728 NameResolver .Factory factory = FallbackResolver .startWith (canResolve ).thenCheck (cannotResolve );
2829
29- assertEquals (fakeResolver , factory .newNameResolver (new URI ("aaa://foo" ), Attributes . EMPTY ));
30+ assertEquals (fakeResolver , factory .newNameResolver (new URI ("aaa://foo" ), fakes . fakeArgs ));
3031 }
3132
3233 @ Test
@@ -37,7 +38,7 @@ public void secondShouldFind() throws Exception {
3738
3839 NameResolver .Factory factory = FallbackResolver .startWith (cannotResolve ).thenCheck (canResolve );
3940
40- assertEquals (fakeResolver , factory .newNameResolver (new URI ("bbb://foo" ), Attributes . EMPTY ));
41+ assertEquals (fakeResolver , factory .newNameResolver (new URI ("bbb://foo" ), fakes . fakeArgs ));
4142 }
4243
4344 @ Test
@@ -46,7 +47,7 @@ public void neitherShouldFind() throws Exception {
4647
4748 NameResolver .Factory factory = FallbackResolver .startWith (cannotResolve ).thenCheck (cannotResolve );
4849
49- assertNull (factory .newNameResolver (new URI ("bbb://foo" ), Attributes . EMPTY ));
50+ assertNull (factory .newNameResolver (new URI ("bbb://foo" ), fakes . fakeArgs ));
5051 }
5152
5253 @ Test
@@ -80,7 +81,7 @@ protected int priority() {
8081 }
8182
8283 @ Override
83- public NameResolver newNameResolver (URI targetUri , Attributes params ) {
84+ public NameResolver newNameResolver (URI targetUri , NameResolver . Args args ) {
8485 return resolver ;
8586 }
8687
0 commit comments