srijeet0406 commented on a change in pull request #6003:
URL: https://github.com/apache/trafficcontrol/pull/6003#discussion_r707461349



##########
File path: traffic_ops/testing/api/v3/profiles_test.go
##########
@@ -269,10 +285,25 @@ func GetTestProfiles(t *testing.T) {
                        t.Errorf("cannot GET Profile by name: %v - %v", err, 
resp)
                }
                profileID := resp[0].ID
-
-               resp, _, err = TOSession.GetProfileByParameter(pr.Parameter)
-               if err != nil {
-                       t.Errorf("cannot GET Profile by param: %v - %v", err, 
resp)
+               if len(pr.Parameters) > 0 {
+                       parameter := pr.Parameters[0]
+                       respParameter, _, _ := 
TOSession.GetParameterByName(*parameter.Name)

Review comment:
       We should probably check for the returned error here.

##########
File path: traffic_ops/testing/api/v3/profiles_test.go
##########
@@ -83,12 +83,28 @@ func GetTestProfilesIMS(t *testing.T) {
                if reqInf.StatusCode != http.StatusNotModified {
                        t.Fatalf("Expected 304 status code, got %v", 
reqInf.StatusCode)
                }
-               _, reqInf, err = 
TOSession.GetProfileByParameterWithHdr(pr.Parameter, header)
-               if err != nil {
-                       t.Fatalf("Expected no error, but got %v", err.Error())
-               }
-               if reqInf.StatusCode != http.StatusNotModified {
-                       t.Fatalf("Expected 304 status code, got %v", 
reqInf.StatusCode)
+               if len(pr.Parameters) > 0 {
+                       parameter := pr.Parameters[0]
+                       respParameter, _, _ := 
TOSession.GetParameterByName(*parameter.Name)

Review comment:
       We should probably check for the returned error here.

##########
File path: traffic_ops/testing/api/v4/profiles_test.go
##########
@@ -518,11 +518,31 @@ func GetTestProfiles(t *testing.T) {
                profileID := resp.Response[0].ID
 
                // TODO: figure out what the 'Parameter' field of a Profile is 
and how

Review comment:
       Any reason to keep that first line in there still?

##########
File path: traffic_ops/testing/api/v2/profiles_test.go
##########
@@ -210,12 +210,26 @@ func GetTestProfiles(t *testing.T) {
                        t.Errorf("cannot GET Profile by name: %v - %v", err, 
resp)
                }
                profileID := resp[0].ID
-
-               resp, _, err = TOSession.GetProfileByParameter(pr.Parameter)
-               if err != nil {
-                       t.Errorf("cannot GET Profile by param: %v - %v", err, 
resp)
+               if len(pr.Parameters) > 0 {
+                       parameter := pr.Parameters[0]
+                       respParameter, _, _ := 
TOSession.GetParameterByName(*parameter.Name)

Review comment:
       We should probably check for the returned error here.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to