@@ -28,7 +28,7 @@ import (
2828 utiltesting "k8s.io/client-go/util/testing"
2929)
3030
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 {
3232 return & v1.Pod {
3333 ObjectMeta : metav1.ObjectMeta {
3434 Name : name ,
@@ -60,9 +60,9 @@ func newDaprAppPod(name string, namespace string, appName string, creationTime t
6060 "--dapr-public-port" ,
6161 "3501" ,
6262 "--app-port" ,
63- "8080" ,
63+ appPort ,
6464 "--app-id" ,
65- "testAppID" ,
65+ appName ,
6666 "--control-plane-address" ,
6767 "dapr-api.keel-system.svc.cluster.local:80" ,
6868 "--app-protocol" ,
@@ -94,7 +94,7 @@ func Test_getAppInfo(t *testing.T) {
9494 client := fake .NewSimpleClientset (newDaprAppPod (
9595 "testAppPod" , "testAppNameSpace" ,
9696 "testAppID" , time .Now (),
97- "80801" , "80802" ))
97+ "8080" , " 80801" , "80802" ))
9898
9999 testCases := []struct {
100100 name string
@@ -109,7 +109,7 @@ func Test_getAppInfo(t *testing.T) {
109109 errorExpected : false ,
110110 errString : "" ,
111111 want : & AppInfo {
112- AppID : "testAppID" , AppPort : "80801" , PodName : "testAppPod" , Namespace : "testAppNameSpace" ,
112+ AppID : "testAppID" , HTTPPort : "80801" , GRPCPort : "80802" , AppPort : "8080 " , PodName : "testAppPod" , Namespace : "testAppNameSpace" ,
113113 },
114114 },
115115 {
@@ -156,7 +156,7 @@ func Test_invoke(t *testing.T) {
156156 method : "hello" ,
157157 verb : "GET" ,
158158 data : nil ,
159- URLExpected : "https://localhost/api/v1/" +
159+ URLExpected : "https://localhost/api/v1/" +
160160 "namespaces/testAppNameSpace/pods/testAppPod:8080/proxy/" +
161161 "hello" ,
162162 },
@@ -189,7 +189,7 @@ func Test_invoke(t *testing.T) {
189189 method : "hello" ,
190190 verb : "POST" ,
191191 data : []byte ("hello" ),
192- URLExpected : "https://localhost/api/v1/" +
192+ URLExpected : "https://localhost/api/v1/" +
193193 "namespaces/testAppNameSpace/pods/testAppPod:8080/proxy/" +
194194 "hello" ,
195195 },
0 commit comments