rimashah25 commented on code in PR #7406:
URL: https://github.com/apache/trafficcontrol/pull/7406#discussion_r1145674878
##########
traffic_ops/traffic_ops_golang/server/servers_test.go:
##########
@@ -722,3 +723,387 @@ func (s SortableServers) Swap(i, j int) {
func (s SortableServers) Less(i, j int) bool {
return s[i].HostName < s[j].HostName
}
+
+func TestUpdateStatusLastUpdatedTime(t *testing.T) {
+ mockDB, mock, err := sqlmock.New()
+ if err != nil {
+ t.Fatalf("an error '%v' was not expected when opening a stub
database connection", err)
+ }
+ defer mockDB.Close()
+
+ db := sqlx.NewDb(mockDB, "sqlmock")
+ defer db.Close()
+
+ lastUpdated := time.Now()
+ mock.ExpectBegin()
+ mock.ExpectExec("UPDATE").WithArgs(lastUpdated,
1).WillReturnResult(sqlmock.NewResult(1, 1))
+ mock.ExpectCommit()
+
+ _, sysErr, code := updateStatusLastUpdatedTime(1, &lastUpdated,
db.MustBegin().Tx)
Review Comment:
Based on our slack conversation, made the appropriate change.
--
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]