ocket8888 commented on a change in pull request #3900: Rewrite 
/cachegroups/{{id}}/parameters to Go
URL: https://github.com/apache/trafficcontrol/pull/3900#discussion_r320753420
 
 

 ##########
 File path: traffic_ops/testing/api/v14/cachegroups_parameters_test.go
 ##########
 @@ -0,0 +1,91 @@
+// /*
+
+//  Licensed under the Apache License, Version 2.0 (the "License");
+//  you may not use this file except in compliance with the License.
+//  You may obtain a copy of the License at
+
+//  http://www.apache.org/licenses/LICENSE-2.0
+
+//  Unless required by applicable law or agreed to in writing, software
+//  distributed under the License is distributed on an "AS IS" BASIS,
+//  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//  See the License for the specific language governing permissions and
+//  limitations under the License.
+// */
+
+package v14
+
+import (
+       "fmt"
+       "testing"
+
+       "github.com/apache/trafficcontrol/lib/go-tc"
+
+       "github.com/apache/trafficcontrol/lib/go-log"
+)
+
+func TestCacheGroupParameters(t *testing.T) {
+       WithObjs(t, []TCObj{Types, Parameters, CacheGroups}, func() {
+               GetTestCacheGroupParameters(t)
+       })
+}
+
+func CreateTestCacheGroupParameters(t *testing.T) {
+
+       firstCacheGroup := testData.CacheGroups[0]
+       cacheGroupResp, _, err := 
TOSession.GetCacheGroupByName(*firstCacheGroup.Name)
 
 Review comment:
   `cacheGroupResp` can be `nil` here, so maybe you wanna check for that if 
there's an error and just `Fatalf` out. Or actually maybe just return, because 
that might mess up object cleanup (citation needed).
   
   Also, `Session.GetCacheGroupByName` is deprecated, instead use 
[`Session.GetCacheGroupNullableByName`](https://godoc.org/github.com/apache/trafficcontrol/traffic_ops/client#Session.GetCacheGroupNullableByName)

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to