@@ -11,8 +11,6 @@ import (
1111 "net/http"
1212 "testing"
1313 "time"
14-
15- "github.com/google/go-cmp/cmp"
1614)
1715
1816func TestEnterpriseService_GetAuditLog (t * testing.T ) {
@@ -54,34 +52,31 @@ func TestEnterpriseService_GetAuditLog(t *testing.T) {
5452 if err != nil {
5553 t .Errorf ("Enterprise.GetAuditLog returned error: %v" , err )
5654 }
57- startedAt , _ := time .Parse (time .RFC3339 , "2021-03-07T00:33:04.000Z" )
58- completedAt , _ := time .Parse (time .RFC3339 , "2021-03-07T00:35:08.000Z" )
5955 timestamp := time .Unix (0 , 1615077308538 * 1e6 )
60-
6156 want := []* AuditEntry {
6257 {
63- Timestamp : & Timestamp {timestamp },
64- DocumentID : String ("beeZYapIUe-wKg5-beadb33" ),
65- Action : String ("workflows.completed_workflow_run" ),
66- Actor : String ("testactor" ),
67- CompletedAt : & Timestamp {completedAt },
68- Conclusion : String ("success" ),
69- CreatedAt : & Timestamp {timestamp },
70- Event : String ("schedule" ),
71- HeadBranch : String ("master" ),
72- HeadSHA : String ("5acdeadbeef64d1a62388e901e5cdc9358644b37" ),
73- Name : String ("Code scanning - action" ),
74- Org : String ("o" ),
75- Repo : String ("o/blue-crayon-1" ),
76- StartedAt : & Timestamp {startedAt },
77- WorkflowID : Int64 (123456 ),
78- WorkflowRunID : Int64 (628312345 ),
58+ Timestamp : & Timestamp {timestamp },
59+ DocumentID : String ("beeZYapIUe-wKg5-beadb33" ),
60+ Action : String ("workflows.completed_workflow_run" ),
61+ Actor : String ("testactor" ),
62+ CreatedAt : & Timestamp {timestamp },
63+ Org : String ("o" ),
64+ AdditionalFields : map [string ]interface {}{
65+ "completed_at" : "2021-03-07T00:35:08.000Z" ,
66+ "conclusion" : "success" ,
67+ "event" : "schedule" ,
68+ "head_branch" : "master" ,
69+ "head_sha" : "5acdeadbeef64d1a62388e901e5cdc9358644b37" ,
70+ "name" : "Code scanning - action" ,
71+ "repo" : "o/blue-crayon-1" ,
72+ "started_at" : "2021-03-07T00:33:04.000Z" ,
73+ "workflow_id" : float64 (123456 ),
74+ "workflow_run_id" : float64 (628312345 ),
75+ },
7976 },
8077 }
8178
82- if ! cmp .Equal (auditEntries , want ) {
83- t .Errorf ("Enterprise.GetAuditLog return \n got: %+v,\n want:%+v" , auditEntries , want )
84- }
79+ assertNoDiff (t , want , auditEntries )
8580
8681 const methodName = "GetAuditLog"
8782 testBadOptions (t , methodName , func () (err error ) {
0 commit comments