TaylorCFrey commented on a change in pull request #6690:
URL: https://github.com/apache/trafficcontrol/pull/6690#discussion_r838921709



##########
File path: traffic_ops/testing/api/v3/deliveryservices_test.go
##########
@@ -17,1180 +17,499 @@ package v3
 
 import (
        "encoding/json"
-       "fmt"
        "net/http"
        "net/url"
-       "reflect"
        "strconv"
-       "strings"
        "testing"
        "time"
 
        "github.com/apache/trafficcontrol/lib/go-rfc"
        "github.com/apache/trafficcontrol/lib/go-tc"
-       "github.com/apache/trafficcontrol/lib/go-util"
-       toclient "github.com/apache/trafficcontrol/traffic_ops/v3-client"
+       "github.com/apache/trafficcontrol/traffic_ops/testing/api/assert"
+       "github.com/apache/trafficcontrol/traffic_ops/testing/api/utils"
+       "github.com/apache/trafficcontrol/traffic_ops/toclientlib"
 )
 
 func TestDeliveryServices(t *testing.T) {
-       WithObjs(t, []TCObj{CDNs, Types, Tenants, Users, Parameters, Profiles, 
Statuses, Divisions, Regions, PhysLocations, CacheGroups, Servers, Topologies, 
ServerCapabilities, DeliveryServices}, func() {
-               currentTime := time.Now().UTC().Add(-5 * time.Second)
-               ti := currentTime.Format(time.RFC1123)
-               var header http.Header
-               header = make(map[string][]string)
-               header.Set(rfc.IfModifiedSince, ti)
-               header.Set(rfc.IfUnmodifiedSince, ti)
-               if includeSystemTests {
-                       SSLDeliveryServiceCDNUpdateTest(t)
-                       GetTestDeliveryServicesURLSigKeys(t)
+       WithObjs(t, []TCObj{CDNs, Types, Tenants, Users, Parameters, Profiles, 
Statuses, Divisions, Regions, PhysLocations, CacheGroups, Servers, Topologies, 
ServerCapabilities, DeliveryServices, DeliveryServicesRequiredCapabilities, 
DeliveryServiceServerAssignments}, func() {
+
+               tomorrow := time.Now().AddDate(0, 0, 1).Format(time.RFC1123)
+               currentTime := time.Now().UTC().Add(-15 * time.Second)
+               currentTimeRFC := currentTime.Format(time.RFC1123)
+
+               tenant4UserSession := utils.CreateV3Session(t, 
Config.TrafficOps.URL, "tenant4user", "pa$$word", 
Config.Default.Session.TimeoutInSecs)
+
+               methodTests := utils.V3TestCase{
+                       "GET": {

Review comment:
       It might behove us to make these HTTP verbs and switch strings `const` 
somewhere
   ```go
   const (
       Get = "GET"
       Post = "POST"
       GetAfterChanges = "GET AFTER CHANGES"
       // ...
   )
   ```
   
   Go's capitalization results in scope changes so the convention of ALL CAPS 
may not be appropriate, but these could be put somewhere so they are accessible 
everywhere? I will leave that decision up to you. Maybe the HTTP verbs could be 
someone globally accessible, but the delivery service specific (`DELIVERY 
SERVICES CAPACITY`) could be local?
   
   I won't put this comment on every verb, but it applies for `GET` `POST` 
`PUT` `DELETE` etc. for both v3 and v4 tests.




-- 
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