Fix build failure for patch 39785
[aaf/sms.git] / sms-service / src / sms / handler / handler_test.go
index e1b5b34..25dc19f 100644 (file)
@@ -199,7 +199,7 @@ func TestDeleteSecretHandler(t *testing.T) {
        hr := http.HandlerFunc(h.deleteSecretHandler)
 
        hr.ServeHTTP(rr, req)
-       if rr.Code != http.StatusOK {
+       if rr.Code != http.StatusNoContent {
                t.Errorf("Expected statusCreated return code. Got: %v", rr.Code)
        }
 }
@@ -249,9 +249,16 @@ func TestListSecretHandler(t *testing.T) {
                t.Errorf("Expected statusCreated return code. Got: %v", rr.Code)
        }
 
-       expected := []string{"testsecret1", "testsecret2"}
+       var expected = struct {
+               SecretNames []string `json:"secretnames"`
+       }{
+               []string{"testsecret1", "testsecret2"},
+       }
+
+       var got struct {
+               SecretNames []string `json:"secretnames"`
+       }
 
-       var got []string
        json.NewDecoder(rr.Body).Decode(&got)
 
        if reflect.DeepEqual(expected, got) == false {