@@ -28,7 +28,7 @@ import (
28
28
utiltesting "k8s.io/client-go/util/testing"
29
29
)
30
30
31
- func newDaprAppPod (name string , namespace string , appName string , creationTime time.Time , httpPort string , grpcPort string ) * v1.Pod {
31
+ func newDaprAppPod (name string , namespace string , appName string , creationTime time.Time , appPort string , httpPort string , grpcPort string ) * v1.Pod {
32
32
return & v1.Pod {
33
33
ObjectMeta : metav1.ObjectMeta {
34
34
Name : name ,
@@ -60,9 +60,9 @@ func newDaprAppPod(name string, namespace string, appName string, creationTime t
60
60
"--dapr-public-port" ,
61
61
"3501" ,
62
62
"--app-port" ,
63
- "8080" ,
63
+ appPort ,
64
64
"--app-id" ,
65
- "testAppID" ,
65
+ appName ,
66
66
"--control-plane-address" ,
67
67
"dapr-api.keel-system.svc.cluster.local:80" ,
68
68
"--app-protocol" ,
@@ -94,7 +94,7 @@ func Test_getAppInfo(t *testing.T) {
94
94
client := fake .NewSimpleClientset (newDaprAppPod (
95
95
"testAppPod" , "testAppNameSpace" ,
96
96
"testAppID" , time .Now (),
97
- "80801" , "80802" ))
97
+ "8080" , " 80801" , "80802" ))
98
98
99
99
testCases := []struct {
100
100
name string
@@ -109,7 +109,7 @@ func Test_getAppInfo(t *testing.T) {
109
109
errorExpected : false ,
110
110
errString : "" ,
111
111
want : & AppInfo {
112
- AppID : "testAppID" , AppPort : "80801" , PodName : "testAppPod" , Namespace : "testAppNameSpace" ,
112
+ AppID : "testAppID" , HTTPPort : "80801" , GRPCPort : "80802" , AppPort : "8080 " , PodName : "testAppPod" , Namespace : "testAppNameSpace" ,
113
113
},
114
114
},
115
115
{
@@ -156,7 +156,7 @@ func Test_invoke(t *testing.T) {
156
156
method : "hello" ,
157
157
verb : "GET" ,
158
158
data : nil ,
159
- URLExpected : "https://localhost/api/v1/" +
159
+ URLExpected : "https://localhost/api/v1/" +
160
160
"namespaces/testAppNameSpace/pods/testAppPod:8080/proxy/" +
161
161
"hello" ,
162
162
},
@@ -189,7 +189,7 @@ func Test_invoke(t *testing.T) {
189
189
method : "hello" ,
190
190
verb : "POST" ,
191
191
data : []byte ("hello" ),
192
- URLExpected : "https://localhost/api/v1/" +
192
+ URLExpected : "https://localhost/api/v1/" +
193
193
"namespaces/testAppNameSpace/pods/testAppPod:8080/proxy/" +
194
194
"hello" ,
195
195
},
0 commit comments