@@ -11,6 +11,7 @@ import (
11
11
func TestNewProvider (t * testing.T ) {
12
12
tests := []struct {
13
13
name string
14
+ expectedResolver ResolverType
14
15
expectPort uint16
15
16
expectHost string
16
17
expectCacheType cache.Type
@@ -24,7 +25,8 @@ func TestNewProvider(t *testing.T) {
24
25
}{
25
26
{
26
27
name : "default construction" ,
27
- expectPort : defaultPort ,
28
+ expectedResolver : rpc ,
29
+ expectPort : defaultRpcPort ,
28
30
expectHost : defaultHost ,
29
31
expectCacheType : defaultCache ,
30
32
expectCertPath : "" ,
@@ -36,6 +38,7 @@ func TestNewProvider(t *testing.T) {
36
38
},
37
39
{
38
40
name : "with options" ,
41
+ expectedResolver : inProcess ,
39
42
expectPort : 9090 ,
40
43
expectHost : "myHost" ,
41
44
expectCacheType : cache .LRUValue ,
@@ -46,6 +49,7 @@ func TestNewProvider(t *testing.T) {
46
49
expectSocketPath : "/socket" ,
47
50
expectTlsEnabled : true ,
48
51
options : []ProviderOption {
52
+ WithInProcessResolver (),
49
53
WithSocketPath ("/socket" ),
50
54
WithOtelInterceptor (true ),
51
55
WithLRUCache (2500 ),
@@ -55,6 +59,38 @@ func TestNewProvider(t *testing.T) {
55
59
WithPort (9090 ),
56
60
},
57
61
},
62
+ {
63
+ name : "default port handling with in-process resolver" ,
64
+ expectedResolver : inProcess ,
65
+ expectPort : defaultInProcessPort ,
66
+ expectHost : defaultHost ,
67
+ expectCacheType : defaultCache ,
68
+ expectCertPath : "" ,
69
+ expectMaxRetries : defaultMaxEventStreamRetries ,
70
+ expectCacheSize : defaultMaxCacheSize ,
71
+ expectOtelIntercept : false ,
72
+ expectSocketPath : "" ,
73
+ expectTlsEnabled : false ,
74
+ options : []ProviderOption {
75
+ WithInProcessResolver (),
76
+ },
77
+ },
78
+ {
79
+ name : "default port handling with in-process resolver" ,
80
+ expectedResolver : rpc ,
81
+ expectPort : defaultRpcPort ,
82
+ expectHost : defaultHost ,
83
+ expectCacheType : defaultCache ,
84
+ expectCertPath : "" ,
85
+ expectMaxRetries : defaultMaxEventStreamRetries ,
86
+ expectCacheSize : defaultMaxCacheSize ,
87
+ expectOtelIntercept : false ,
88
+ expectSocketPath : "" ,
89
+ expectTlsEnabled : false ,
90
+ options : []ProviderOption {
91
+ WithRPCResolver (),
92
+ },
93
+ },
58
94
}
59
95
60
96
for _ , test := range tests {
0 commit comments