From f0c3306d4b52c7cf1fb8f80532dbf23edf97ab59 Mon Sep 17 00:00:00 2001 From: sagar23sj Date: Wed, 7 Jul 2021 00:26:35 +0530 Subject: [PATCH 01/13] Resource Tested for JSON marshalling : CheckRunAnnotation --- github/checks_test.go | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/github/checks_test.go b/github/checks_test.go index 5d3315fd8b2..54ec3b27717 100644 --- a/github/checks_test.go +++ b/github/checks_test.go @@ -949,3 +949,33 @@ func Test_CheckSuiteMarshal(t *testing.T) { testJSONMarshal(t, &c, w) } + +func TestCheckRunAnnotation_Marshal(t *testing.T) { + testJSONMarshal(t, &CheckRunAnnotation{}, "{}") + + u := &CheckRunAnnotation{ + Path: String("p"), + StartLine: Int(1), + EndLine: Int(1), + StartColumn: Int(1), + EndColumn: Int(1), + AnnotationLevel: String("al"), + Message: String("m"), + Title: String("t"), + RawDetails: String("rd"), + } + + want := `{ + "path": "p", + "start_line": 1, + "end_line": 1, + "start_column": 1, + "end_column": 1, + "annotation_level": "al", + "message": "m", + "title": "t", + "raw_details": "rd" + }` + + testJSONMarshal(t, u, want) +} From 1899c217fb411d56df72021b8c10205b6eb59606 Mon Sep 17 00:00:00 2001 From: sagar23sj Date: Wed, 7 Jul 2021 00:32:25 +0530 Subject: [PATCH 02/13] Resource Tested for JSON marshalling : CheckRunImage --- github/checks_test.go | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/github/checks_test.go b/github/checks_test.go index 54ec3b27717..9fac7c293f9 100644 --- a/github/checks_test.go +++ b/github/checks_test.go @@ -979,3 +979,21 @@ func TestCheckRunAnnotation_Marshal(t *testing.T) { testJSONMarshal(t, u, want) } + +func TestCheckRunImage_Marshal(t *testing.T) { + testJSONMarshal(t, &CheckRunImage{}, "{}") + + u := &CheckRunImage{ + Alt: String("a"), + ImageURL: String("i"), + Caption: String("c"), + } + + want := `{ + "alt": "a", + "image_url": "i", + "caption": "c" + }` + + testJSONMarshal(t, u, want) +} From c1684ad7a101219f4172544d0fd56a89b9c606a7 Mon Sep 17 00:00:00 2001 From: sagar23sj Date: Wed, 7 Jul 2021 00:35:48 +0530 Subject: [PATCH 03/13] Resource Tested for JSON marshalling : CheckRunAction --- github/checks_test.go | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/github/checks_test.go b/github/checks_test.go index 9fac7c293f9..19158043a11 100644 --- a/github/checks_test.go +++ b/github/checks_test.go @@ -997,3 +997,21 @@ func TestCheckRunImage_Marshal(t *testing.T) { testJSONMarshal(t, u, want) } + +func TestCheckRunAction_Marshal(t *testing.T) { + testJSONMarshal(t, &CheckRunAction{}, "{}") + + u := &CheckRunAction{ + Label: "l", + Description: "d", + Identifier: "i", + } + + want := `{ + "label": "l", + "description": "d", + "identifier": "i" + }` + + testJSONMarshal(t, u, want) +} From 923e15b6a7405432720233bc299af27307836f72 Mon Sep 17 00:00:00 2001 From: sagar23sj Date: Wed, 7 Jul 2021 00:38:54 +0530 Subject: [PATCH 04/13] Resource Tested for JSON marshalling : AutoTriggerCheck --- github/checks_test.go | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/github/checks_test.go b/github/checks_test.go index 19158043a11..7257cd6ebc1 100644 --- a/github/checks_test.go +++ b/github/checks_test.go @@ -1015,3 +1015,19 @@ func TestCheckRunAction_Marshal(t *testing.T) { testJSONMarshal(t, u, want) } + +func TestAutoTriggerCheck_Marshal(t *testing.T) { + testJSONMarshal(t, &AutoTriggerCheck{}, "{}") + + u := &AutoTriggerCheck{ + AppID: Int64(1), + Setting: Bool(false), + } + + want := `{ + "app_id": 1, + "setting": false + }` + + testJSONMarshal(t, u, want) +} From a46f70f42ee65b2bf50ea77174445967ca30b0c1 Mon Sep 17 00:00:00 2001 From: sagar23sj Date: Wed, 7 Jul 2021 00:42:30 +0530 Subject: [PATCH 05/13] Resource Tested for JSON marshalling : CreateCheckSuiteOptions --- github/checks_test.go | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/github/checks_test.go b/github/checks_test.go index 7257cd6ebc1..9592267cde2 100644 --- a/github/checks_test.go +++ b/github/checks_test.go @@ -1031,3 +1031,19 @@ func TestAutoTriggerCheck_Marshal(t *testing.T) { testJSONMarshal(t, u, want) } + +func TestCreateCheckSuiteOptions_Marshal(t *testing.T) { + testJSONMarshal(t, &CreateCheckSuiteOptions{}, "{}") + + u := &CreateCheckSuiteOptions{ + HeadSHA: "hsha", + HeadBranch: String("hb"), + } + + want := `{ + "head_sha": "hsha", + "head_branch": "hb" + }` + + testJSONMarshal(t, u, want) +} From 4c17073af2e762a3d24a4f77543ab32e6f6313aa Mon Sep 17 00:00:00 2001 From: sagar23sj Date: Wed, 7 Jul 2021 00:50:48 +0530 Subject: [PATCH 06/13] Resource Tested for JSON marshalling : CheckRunOutput --- github/checks_test.go | 62 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) diff --git a/github/checks_test.go b/github/checks_test.go index 9592267cde2..c761347e3e9 100644 --- a/github/checks_test.go +++ b/github/checks_test.go @@ -1047,3 +1047,65 @@ func TestCreateCheckSuiteOptions_Marshal(t *testing.T) { testJSONMarshal(t, u, want) } + +func TestCheckRunOutput_Marshal(t *testing.T) { + testJSONMarshal(t, &CheckRunOutput{}, "{}") + + u := &CheckRunOutput{ + Title: String("ti"), + Summary: String("s"), + Text: String("t"), + AnnotationsCount: Int(1), + AnnotationsURL: String("au"), + Annotations: []*CheckRunAnnotation{ + { + Path: String("p"), + StartLine: Int(1), + EndLine: Int(1), + StartColumn: Int(1), + EndColumn: Int(1), + AnnotationLevel: String("al"), + Message: String("m"), + Title: String("t"), + RawDetails: String("rd"), + }, + }, + Images: []*CheckRunImage{ + { + Alt: String("a"), + ImageURL: String("i"), + Caption: String("c"), + }, + }, + } + + want := `{ + "title": "ti", + "summary": "s", + "text": "t", + "annotations_count": 1, + "annotations_url": "au", + "annotations": [ + { + "path": "p", + "start_line": 1, + "end_line": 1, + "start_column": 1, + "end_column": 1, + "annotation_level": "al", + "message": "m", + "title": "t", + "raw_details": "rd" + } + ], + "images": [ + { + "alt": "a", + "image_url": "i", + "caption": "c" + } + ] + }` + + testJSONMarshal(t, u, want) +} From 0cf65dd7d250e51e4444fd2f12c7fe4895b0e276 Mon Sep 17 00:00:00 2001 From: sagar23sj Date: Wed, 7 Jul 2021 01:02:26 +0530 Subject: [PATCH 07/13] Resource Tested for JSON marshalling : CreateCheckRunOptions --- github/checks_test.go | 96 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 96 insertions(+) diff --git a/github/checks_test.go b/github/checks_test.go index c761347e3e9..008c1676f6f 100644 --- a/github/checks_test.go +++ b/github/checks_test.go @@ -1109,3 +1109,99 @@ func TestCheckRunOutput_Marshal(t *testing.T) { testJSONMarshal(t, u, want) } + +func TestCreateCheckRunOptions_Marshal(t *testing.T) { + testJSONMarshal(t, &CreateCheckRunOptions{}, "{}") + + u := &CreateCheckRunOptions{ + Name: "n", + HeadSHA: "hsha", + DetailsURL: String("durl"), + ExternalID: String("eid"), + Status: String("s"), + Conclusion: String("c"), + StartedAt: &Timestamp{referenceTime}, + CompletedAt: &Timestamp{referenceTime}, + Output: &CheckRunOutput{ + Title: String("ti"), + Summary: String("s"), + Text: String("t"), + AnnotationsCount: Int(1), + AnnotationsURL: String("au"), + Annotations: []*CheckRunAnnotation{ + { + Path: String("p"), + StartLine: Int(1), + EndLine: Int(1), + StartColumn: Int(1), + EndColumn: Int(1), + AnnotationLevel: String("al"), + Message: String("m"), + Title: String("t"), + RawDetails: String("rd"), + }, + }, + Images: []*CheckRunImage{ + { + Alt: String("a"), + ImageURL: String("i"), + Caption: String("c"), + }, + }, + }, + Actions: []*CheckRunAction{ + { + Label: "l", + Description: "d", + Identifier: "i", + }, + }, + } + + want := `{ + "name": "n", + "head_sha": "hsha", + "details_url": "durl", + "external_id": "eid", + "status": "s", + "conclusion": "c", + "started_at": ` + referenceTimeStr + `, + "completed_at": ` + referenceTimeStr + `, + "output": { + "title": "ti", + "summary": "s", + "text": "t", + "annotations_count": 1, + "annotations_url": "au", + "annotations": [ + { + "path": "p", + "start_line": 1, + "end_line": 1, + "start_column": 1, + "end_column": 1, + "annotation_level": "al", + "message": "m", + "title": "t", + "raw_details": "rd" + } + ], + "images": [ + { + "alt": "a", + "image_url": "i", + "caption": "c" + } + ] + }, + "actions": [ + { + "label": "l", + "description": "d", + "identifier": "i" + } + ] + }` + + testJSONMarshal(t, u, want) +} From 038a2db2f322e46728e38d4caa30f5cb65fcf85c Mon Sep 17 00:00:00 2001 From: sagar23sj Date: Wed, 7 Jul 2021 01:06:40 +0530 Subject: [PATCH 08/13] Resource Tested for JSON marshalling : UpdateCheckRunOptions --- github/checks_test.go | 92 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 92 insertions(+) diff --git a/github/checks_test.go b/github/checks_test.go index 008c1676f6f..4c718a3eb9e 100644 --- a/github/checks_test.go +++ b/github/checks_test.go @@ -1205,3 +1205,95 @@ func TestCreateCheckRunOptions_Marshal(t *testing.T) { testJSONMarshal(t, u, want) } + +func TestUpdateCheckRunOptions_Marshal(t *testing.T) { + testJSONMarshal(t, &UpdateCheckRunOptions{}, "{}") + + u := &UpdateCheckRunOptions{ + Name: "n", + DetailsURL: String("durl"), + ExternalID: String("eid"), + Status: String("s"), + Conclusion: String("c"), + CompletedAt: &Timestamp{referenceTime}, + Output: &CheckRunOutput{ + Title: String("ti"), + Summary: String("s"), + Text: String("t"), + AnnotationsCount: Int(1), + AnnotationsURL: String("au"), + Annotations: []*CheckRunAnnotation{ + { + Path: String("p"), + StartLine: Int(1), + EndLine: Int(1), + StartColumn: Int(1), + EndColumn: Int(1), + AnnotationLevel: String("al"), + Message: String("m"), + Title: String("t"), + RawDetails: String("rd"), + }, + }, + Images: []*CheckRunImage{ + { + Alt: String("a"), + ImageURL: String("i"), + Caption: String("c"), + }, + }, + }, + Actions: []*CheckRunAction{ + { + Label: "l", + Description: "d", + Identifier: "i", + }, + }, + } + + want := `{ + "name": "n", + "details_url": "durl", + "external_id": "eid", + "status": "s", + "conclusion": "c", + "completed_at": ` + referenceTimeStr + `, + "output": { + "title": "ti", + "summary": "s", + "text": "t", + "annotations_count": 1, + "annotations_url": "au", + "annotations": [ + { + "path": "p", + "start_line": 1, + "end_line": 1, + "start_column": 1, + "end_column": 1, + "annotation_level": "al", + "message": "m", + "title": "t", + "raw_details": "rd" + } + ], + "images": [ + { + "alt": "a", + "image_url": "i", + "caption": "c" + } + ] + }, + "actions": [ + { + "label": "l", + "description": "d", + "identifier": "i" + } + ] + }` + + testJSONMarshal(t, u, want) +} From bc72a5bcc633bab21d4f08bf4c080b22ee59ee5e Mon Sep 17 00:00:00 2001 From: sagar23sj Date: Wed, 7 Jul 2021 01:29:35 +0530 Subject: [PATCH 09/13] Resource Tested for JSON marshalling : ListCheckRunsResults --- github/checks_test.go | 190 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 190 insertions(+) diff --git a/github/checks_test.go b/github/checks_test.go index 4c718a3eb9e..0e1d73c02ef 100644 --- a/github/checks_test.go +++ b/github/checks_test.go @@ -1297,3 +1297,193 @@ func TestUpdateCheckRunOptions_Marshal(t *testing.T) { testJSONMarshal(t, u, want) } + +func TestListCheckRunsResults_Marshal(t *testing.T) { + testJSONMarshal(t, &ListCheckRunsResults{}, "{}") + + l := &ListCheckRunsResults{ + Total: Int(1), + CheckRuns: []*CheckRun{ + { + ID: Int64(1), + NodeID: String("n"), + HeadSHA: String("h"), + ExternalID: String("1"), + URL: String("u"), + HTMLURL: String("u"), + DetailsURL: String("u"), + Status: String("s"), + Conclusion: String("c"), + StartedAt: &Timestamp{referenceTime}, + CompletedAt: &Timestamp{referenceTime}, + Output: &CheckRunOutput{ + Annotations: []*CheckRunAnnotation{ + { + AnnotationLevel: String("a"), + EndLine: Int(1), + Message: String("m"), + Path: String("p"), + RawDetails: String("r"), + StartLine: Int(1), + Title: String("t"), + }, + }, + AnnotationsCount: Int(1), + AnnotationsURL: String("a"), + Images: []*CheckRunImage{ + { + Alt: String("a"), + ImageURL: String("i"), + Caption: String("c"), + }, + }, + Title: String("t"), + Summary: String("s"), + Text: String("t"), + }, + Name: String("n"), + CheckSuite: &CheckSuite{ + ID: Int64(1), + }, + App: &App{ + ID: Int64(1), + NodeID: String("n"), + Owner: &User{ + Login: String("l"), + ID: Int64(1), + NodeID: String("n"), + URL: String("u"), + ReposURL: String("r"), + EventsURL: String("e"), + AvatarURL: String("a"), + }, + Name: String("n"), + Description: String("d"), + HTMLURL: String("h"), + ExternalURL: String("u"), + CreatedAt: &Timestamp{referenceTime}, + UpdatedAt: &Timestamp{referenceTime}, + }, + PullRequests: []*PullRequest{ + { + URL: String("u"), + ID: Int64(1), + Number: Int(1), + Head: &PullRequestBranch{ + Ref: String("r"), + SHA: String("s"), + Repo: &Repository{ + ID: Int64(1), + URL: String("s"), + Name: String("n"), + }, + }, + Base: &PullRequestBranch{ + Ref: String("r"), + SHA: String("s"), + Repo: &Repository{ + ID: Int64(1), + URL: String("u"), + Name: String("n"), + }, + }, + }, + }, + }, + }, + } + + w := `{ + "total_count": 1, + "check_runs": [ + { + "id": 1, + "node_id": "n", + "head_sha": "h", + "external_id": "1", + "url": "u", + "html_url": "u", + "details_url": "u", + "status": "s", + "conclusion": "c", + "started_at": ` + referenceTimeStr + `, + "completed_at": ` + referenceTimeStr + `, + "output": { + "title": "t", + "summary": "s", + "text": "t", + "annotations_count": 1, + "annotations_url": "a", + "annotations": [ + { + "path": "p", + "start_line": 1, + "end_line": 1, + "annotation_level": "a", + "message": "m", + "title": "t", + "raw_details": "r" + } + ], + "images": [ + { + "alt": "a", + "image_url": "i", + "caption": "c" + } + ] + }, + "name": "n", + "check_suite": { + "id": 1 + }, + "app": { + "id": 1, + "node_id": "n", + "owner": { + "login": "l", + "id": 1, + "node_id": "n", + "avatar_url": "a", + "url": "u", + "events_url": "e", + "repos_url": "r" + }, + "name": "n", + "description": "d", + "external_url": "u", + "html_url": "h", + "created_at": ` + referenceTimeStr + `, + "updated_at": ` + referenceTimeStr + ` + }, + "pull_requests": [ + { + "id": 1, + "number": 1, + "url": "u", + "head": { + "ref": "r", + "sha": "s", + "repo": { + "id": 1, + "name": "n", + "url": "s" + } + }, + "base": { + "ref": "r", + "sha": "s", + "repo": { + "id": 1, + "name": "n", + "url": "u" + } + } + } + ] + } + ] + }` + + testJSONMarshal(t, &l, w) +} From d76432af43922a2d81654010d400e26fa05fa24d Mon Sep 17 00:00:00 2001 From: sagar23sj Date: Wed, 7 Jul 2021 01:38:08 +0530 Subject: [PATCH 10/13] Resource Tested for JSON marshalling : ListCheckSuiteResults --- github/checks_test.go | 140 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 140 insertions(+) diff --git a/github/checks_test.go b/github/checks_test.go index 0e1d73c02ef..6972f0a4131 100644 --- a/github/checks_test.go +++ b/github/checks_test.go @@ -1487,3 +1487,143 @@ func TestListCheckRunsResults_Marshal(t *testing.T) { testJSONMarshal(t, &l, w) } + +func TestListCheckSuiteResults_Marshal(t *testing.T) { + testJSONMarshal(t, &ListCheckSuiteResults{}, "{}") + + l := &ListCheckSuiteResults{ + Total: Int(1), + CheckSuites: []*CheckSuite{ + { + ID: Int64(1), + NodeID: String("n"), + HeadBranch: String("h"), + HeadSHA: String("h"), + URL: String("u"), + BeforeSHA: String("b"), + AfterSHA: String("a"), + Status: String("s"), + Conclusion: String("c"), + App: &App{ + ID: Int64(1), + NodeID: String("n"), + Owner: &User{ + Login: String("l"), + ID: Int64(1), + NodeID: String("n"), + URL: String("u"), + ReposURL: String("r"), + EventsURL: String("e"), + AvatarURL: String("a"), + }, + Name: String("n"), + Description: String("d"), + HTMLURL: String("h"), + ExternalURL: String("u"), + CreatedAt: &Timestamp{referenceTime}, + UpdatedAt: &Timestamp{referenceTime}, + }, + Repository: &Repository{ + ID: Int64(1), + }, + PullRequests: []*PullRequest{ + { + URL: String("u"), + ID: Int64(1), + Number: Int(1), + Head: &PullRequestBranch{ + Ref: String("r"), + SHA: String("s"), + Repo: &Repository{ + ID: Int64(1), + URL: String("s"), + Name: String("n"), + }, + }, + Base: &PullRequestBranch{ + Ref: String("r"), + SHA: String("s"), + Repo: &Repository{ + ID: Int64(1), + URL: String("u"), + Name: String("n"), + }, + }, + }, + }, + HeadCommit: &Commit{ + SHA: String("s"), + }, + }, + }, + } + + w := `{ + "total_count": 1, + "check_suites": [ + { + "id": 1, + "node_id": "n", + "head_branch": "h", + "head_sha": "h", + "url": "u", + "before": "b", + "after": "a", + "status": "s", + "conclusion": "c", + "app": { + "id": 1, + "node_id": "n", + "owner": { + "login": "l", + "id": 1, + "node_id": "n", + "avatar_url": "a", + "url": "u", + "events_url": "e", + "repos_url": "r" + }, + "name": "n", + "description": "d", + "external_url": "u", + "html_url": "h", + "created_at": ` + referenceTimeStr + `, + "updated_at": ` + referenceTimeStr + ` + }, + "repository": { + "id": 1 + }, + "pull_requests": [ + { + "id": 1, + "number": 1, + "url": "u", + "head": { + "ref": "r", + "sha": "s", + "repo": { + "id": 1, + "name": "n", + "url": "s" + } + }, + "base": { + "ref": "r", + "sha": "s", + "repo": { + "id": 1, + "name": "n", + "url": "u" + } + } + } + ], + "head_commit": { + "sha": "s" + } + } + ] + }` + + testJSONMarshal(t, &l, w) +} From 87df43db66ee3ff08d70a5f1d344404a7e6a6058 Mon Sep 17 00:00:00 2001 From: sagar23sj Date: Wed, 7 Jul 2021 01:42:46 +0530 Subject: [PATCH 11/13] Resource Tested for JSON marshalling : CheckSuitePreferenceOptions --- github/checks_test.go | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/github/checks_test.go b/github/checks_test.go index 6972f0a4131..0d165a109da 100644 --- a/github/checks_test.go +++ b/github/checks_test.go @@ -1627,3 +1627,27 @@ func TestListCheckSuiteResults_Marshal(t *testing.T) { testJSONMarshal(t, &l, w) } + +func TestCheckSuitePreferenceOptions_Marshal(t *testing.T) { + testJSONMarshal(t, &CheckSuitePreferenceOptions{}, "{}") + + u := &CheckSuitePreferenceOptions{ + AutoTriggerChecks: []*AutoTriggerCheck{ + { + AppID: Int64(1), + Setting: Bool(false), + }, + }, + } + + want := `{ + "auto_trigger_checks": [ + { + "app_id": 1, + "setting": false + } + ] + }` + + testJSONMarshal(t, u, want) +} From a9cb8e5f24565b66aa65b0aba48d1b3519afd1a8 Mon Sep 17 00:00:00 2001 From: sagar23sj Date: Wed, 7 Jul 2021 01:45:04 +0530 Subject: [PATCH 12/13] Resource Tested for JSON marshalling : PreferenceList --- github/checks_test.go | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/github/checks_test.go b/github/checks_test.go index 0d165a109da..a37aed866ac 100644 --- a/github/checks_test.go +++ b/github/checks_test.go @@ -1651,3 +1651,27 @@ func TestCheckSuitePreferenceOptions_Marshal(t *testing.T) { testJSONMarshal(t, u, want) } + +func TestPreferenceList_Marshal(t *testing.T) { + testJSONMarshal(t, &PreferenceList{}, "{}") + + u := &PreferenceList{ + AutoTriggerChecks: []*AutoTriggerCheck{ + { + AppID: Int64(1), + Setting: Bool(false), + }, + }, + } + + want := `{ + "auto_trigger_checks": [ + { + "app_id": 1, + "setting": false + } + ] + }` + + testJSONMarshal(t, u, want) +} From f2260a0e243c539568f92f44b1919f544f120dc2 Mon Sep 17 00:00:00 2001 From: sagar23sj Date: Wed, 7 Jul 2021 01:55:28 +0530 Subject: [PATCH 13/13] Resource Tested for JSON marshalling : CheckSuitePreferenceResults --- github/checks_test.go | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/github/checks_test.go b/github/checks_test.go index a37aed866ac..26da9abf780 100644 --- a/github/checks_test.go +++ b/github/checks_test.go @@ -1675,3 +1675,41 @@ func TestPreferenceList_Marshal(t *testing.T) { testJSONMarshal(t, u, want) } + +func TestCheckSuitePreferenceResults_Marshal(t *testing.T) { + testJSONMarshal(t, &CheckSuitePreferenceResults{}, "{}") + + u := &CheckSuitePreferenceResults{ + Preferences: &PreferenceList{ + AutoTriggerChecks: []*AutoTriggerCheck{ + { + AppID: Int64(1), + Setting: Bool(false), + }, + }, + }, + Repository: &Repository{ + ID: Int64(1), + URL: String("u"), + Name: String("n"), + }, + } + + want := `{ + "preferences": { + "auto_trigger_checks": [ + { + "app_id": 1, + "setting": false + } + ] + }, + "repository": { + "id":1, + "name":"n", + "url":"u" + } + }` + + testJSONMarshal(t, u, want) +}