You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficcontrol.apache.org by de...@apache.org on 2018/08/06 15:48:36 UTC

[trafficcontrol] 07/08: Post-rebase fix cachegroup API tests for localizationMethods

This is an automated email from the ASF dual-hosted git repository.

dewrich pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/trafficcontrol.git

commit beb93c00a1b7b0aa80e9180c1bad62ab34323605
Author: Rawlin Peters <ra...@comcast.com>
AuthorDate: Thu Jul 26 08:37:03 2018 -0600

    Post-rebase fix cachegroup API tests for localizationMethods
    
    Use the new CacheGroupNullable methods.
---
 traffic_ops/testing/api/v13/cachegroups_test.go | 15 ++++++++-------
 1 file changed, 8 insertions(+), 7 deletions(-)

diff --git a/traffic_ops/testing/api/v13/cachegroups_test.go b/traffic_ops/testing/api/v13/cachegroups_test.go
index 9eccb1a..9891756 100644
--- a/traffic_ops/testing/api/v13/cachegroups_test.go
+++ b/traffic_ops/testing/api/v13/cachegroups_test.go
@@ -21,6 +21,7 @@ import (
 	"testing"
 
 	"github.com/apache/trafficcontrol/lib/go-log"
+	"github.com/apache/trafficcontrol/lib/go-tc"
 	"github.com/apache/trafficcontrol/lib/go-tc/v13"
 	"github.com/apache/trafficcontrol/traffic_ops/testing/api/utils"
 )
@@ -160,21 +161,21 @@ func UpdateTestCacheGroups(t *testing.T) {
 
 	// test localizationMethods
 	expectedMethods := []tc.LocalizationMethod{tc.LocalizationMethodGeo}
-	cg.LocalizationMethods = expectedMethods
-	alert, _, err = TOSession.UpdateCacheGroupByID(cg.ID, cg)
+	cg.LocalizationMethods = &expectedMethods
+	updResp, _, err = TOSession.UpdateCacheGroupNullableByID(*cg.ID, cg)
 	if err != nil {
-		t.Errorf("cannot UPDATE CacheGroup by id: %v - %v\n", err, alert)
+		t.Errorf("cannot UPDATE CacheGroup by id: %v - %v\n", err, updResp)
 		failed = true
 	}
 
-	resp, _, err = TOSession.GetCacheGroupByID(cg.ID)
+	resp, _, err = TOSession.GetCacheGroupNullableByID(*cg.ID)
 	if err != nil {
-		t.Errorf("cannot GET CacheGroup by id: '%d', %v\n", cg.ID, err)
+		t.Errorf("cannot GET CacheGroup by id: '%d', %v\n", *cg.ID, err)
 		failed = true
 	}
 	cg = resp[0]
-	if !reflect.DeepEqual(expectedMethods, cg.LocalizationMethods) {
-		t.Errorf("failed to update localizationMethods (expected = %v, actual = %v\n", expectedMethods, cg.LocalizationMethods)
+	if !reflect.DeepEqual(expectedMethods, *cg.LocalizationMethods) {
+		t.Errorf("failed to update localizationMethods (expected = %v, actual = %v\n", expectedMethods, *cg.LocalizationMethods)
 		failed = true
 	}