veyron/services/wsprd/app: Test hack for transition to the new security model.

This is a temporary hack to keep wspr tests passing once
https://veyron-review.googlesource.com/#/c/5279
is committed.

Subsequent changes will update wspr so that it doesn't use
the old security model and thus does not need this hack.

Change-Id: I6bcf6f705949fc918e3794c2963c55f9e7ae4536
diff --git a/services/wsprd/app/app_test.go b/services/wsprd/app/app_test.go
index 9b20dfa..da71692 100644
--- a/services/wsprd/app/app_test.go
+++ b/services/wsprd/app/app_test.go
@@ -4,6 +4,7 @@
 	"encoding/json"
 	"fmt"
 	"reflect"
+	"strings"
 	"testing"
 
 	"veyron.io/veyron/veyron2"
@@ -584,7 +585,7 @@
 						"Handle": 2.0,
 						"Names":  names,
 					},
-					"localEndpoint":  endpoint.String(),
+					"localEndpoint":  hackEndpointStringForOldSecurityModel(endpoint.String()),
 					"remoteEndpoint": "remoteEndpoint",
 				},
 			},
@@ -640,7 +641,7 @@
 						"Handle": 4.0,
 						"Names":  names,
 					},
-					"localEndpoint":  endpoint.String(),
+					"localEndpoint":  hackEndpointStringForOldSecurityModel(endpoint.String()),
 					"remoteEndpoint": "remoteEndpoint",
 				},
 			},
@@ -853,3 +854,12 @@
 		}
 	}
 }
+
+// TODO(ashankar): Remove this when WSPRD is switched to using the new security API.
+func hackEndpointStringForOldSecurityModel(str string) string {
+	suffix := "@4@@"
+	if strings.HasSuffix(str, suffix) {
+		return strings.TrimSuffix(str, suffix) + "@2@@"
+	}
+	return str
+}