diff --git a/github/code-scanning.go b/github/code-scanning.go index 8602c446322..640ec899f54 100644 --- a/github/code-scanning.go +++ b/github/code-scanning.go @@ -18,9 +18,44 @@ import ( // GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/code-scanning/ type CodeScanningService service +// Rule represents the complete details of GitHub Code Scanning alert type. +type Rule struct { + ID *string `json:"id,omitempty"` + Severity *string `json:"severity,omitempty"` + Description *string `json:"description,omitempty"` + Name *string `json:"name,omitempty"` + FullDescription *string `json:"full_description,omitempty"` + Tags []string `json:"tags,omitempty"` + Help *string `json:"help,omitempty"` +} + +// Location represents the exact location of the GitHub Code Scanning Alert in the scanned project. +type Location struct { + Path *string `json:"path,omitempty"` + StartLine *int `json:"start_line,omitempty"` + EndLine *int `json:"end_line,omitempty"` + StartColumn *int `json:"start_column,omitempty"` + EndColumn *int `json:"end_column,omitempty"` +} + +// Message is a part of MostRecentInstance struct which provides the appropriate message when any action is performed on the analysis object. +type Message struct { + Text *string `json:"text,omitempty"` +} + +// MostRecentInstance provides details of the most recent instance of this alert for the default branch or for the specified Git reference. +type MostRecentInstance struct { + Ref *string `json:"ref,omitempty"` + AnalysisKey *string `json:"analysis_key,omitempty"` + Environment *string `json:"environment,omitempty"` + State *string `json:"state,omitempty"` + CommitSHA *string `json:"commit_sha,omitempty"` + Message *Message `json:"message,omitempty"` + Location *Location `json:"location,omitempty"` + Classifications []string `json:"classifications,omitempty"` +} + // Tool represents the tool used to generate a GitHub Code Scanning Alert. -// -// GitHub API docs: https://docs.github.com/en/rest/reference/code-scanning#list-code-scanning-alerts-for-a-repository type Tool struct { Name *string `json:"name,omitempty"` GUID *string `json:"guid,omitempty"` @@ -31,16 +66,22 @@ type Tool struct { // // GitHub API docs: https://docs.github.com/en/rest/reference/code-scanning#list-code-scanning-alerts-for-a-repository type Alert struct { - RuleID *string `json:"rule_id,omitempty"` - RuleSeverity *string `json:"rule_severity,omitempty"` - RuleDescription *string `json:"rule_description,omitempty"` - Tool *Tool `json:"tool,omitempty"` - CreatedAt *Timestamp `json:"created_at,omitempty"` - Open *bool `json:"open,omitempty"` - ClosedBy *User `json:"closed_by,omitempty"` - ClosedAt *Timestamp `json:"closed_at,omitempty"` - URL *string `json:"url,omitempty"` - HTMLURL *string `json:"html_url,omitempty"` + RuleID *string `json:"rule_id,omitempty"` + RuleSeverity *string `json:"rule_severity,omitempty"` + RuleDescription *string `json:"rule_description,omitempty"` + Rule *Rule `json:"rule,omitempty"` + Tool *Tool `json:"tool,omitempty"` + CreatedAt *Timestamp `json:"created_at,omitempty"` + Open *bool `json:"open,omitempty"` + ClosedBy *User `json:"closed_by,omitempty"` + ClosedAt *Timestamp `json:"closed_at,omitempty"` + URL *string `json:"url,omitempty"` + HTMLURL *string `json:"html_url,omitempty"` + MostRecentInstance *MostRecentInstance `json:"most_recent_instance,omitempty"` + DismissedBy *User `json:"dismissed_by,omitempty"` + DismissedAt *Timestamp `json:"dismissed_at,omitempty"` + DismissedReason *string `json:"dismissed_reason,omitempty"` + InstancesURL *string `json:"instances_url,omitempty"` } // ID returns the ID associated with an alert. It is the number at the end of the security alert's URL. diff --git a/github/code-scanning_test.go b/github/code-scanning_test.go index efbc9bd6228..7403582fc58 100644 --- a/github/code-scanning_test.go +++ b/github/code-scanning_test.go @@ -69,6 +69,32 @@ func TestActionsService_ListAlertsForRepo(t *testing.T) { "guid": null, "version": "1.4.0" }, + "rule": { + "id": "js/trivial-conditional", + "severity": "warning", + "description": "Useless conditional", + "name": "js/trivial-conditional", + "full_description": "Expression has no effect", + "help": "Expression has no effect" + }, + "most_recent_instance": { + "ref": "refs/heads/main", + "state": "open", + "commit_sha": "abcdefg12345", + "message": { + "text": "This path depends on a user-provided value." + }, + "location": { + "path": "spec-main/api-session-spec.ts", + "start_line": 917, + "end_line": 917, + "start_column": 7, + "end_column": 18 + }, + "classifications": [ + "test" + ] + }, "created_at":"2020-05-06T12:00:00Z", "open":true, "closed_by":null, @@ -85,6 +111,32 @@ func TestActionsService_ListAlertsForRepo(t *testing.T) { "guid": null, "version": "1.4.0" }, + "rule": { + "id": "js/useless-expression", + "severity": "warning", + "description": "Expression has no effect", + "name": "js/useless-expression", + "full_description": "Expression has no effect", + "help": "Expression has no effect" + }, + "most_recent_instance": { + "ref": "refs/heads/main", + "state": "open", + "commit_sha": "abcdefg12345", + "message": { + "text": "This path depends on a user-provided value." + }, + "location": { + "path": "spec-main/api-session-spec.ts", + "start_line": 917, + "end_line": 917, + "start_column": 7, + "end_column": 18 + }, + "classifications": [ + "test" + ] + }, "created_at":"2020-05-06T12:00:00Z", "open":true, "closed_by":null, @@ -108,24 +160,72 @@ func TestActionsService_ListAlertsForRepo(t *testing.T) { RuleSeverity: String("warning"), RuleDescription: String("Useless conditional"), Tool: &Tool{Name: String("CodeQL"), GUID: nil, Version: String("1.4.0")}, - CreatedAt: &date, - Open: Bool(true), - ClosedBy: nil, - ClosedAt: nil, - URL: String("https://api.github.com/repos/o/r/code-scanning/alerts/25"), - HTMLURL: String("https://github.com/o/r/security/code-scanning/25"), + Rule: &Rule{ + ID: String("js/trivial-conditional"), + Severity: String("warning"), + Description: String("Useless conditional"), + Name: String("js/trivial-conditional"), + FullDescription: String("Expression has no effect"), + Help: String("Expression has no effect"), + }, + CreatedAt: &date, + Open: Bool(true), + ClosedBy: nil, + ClosedAt: nil, + URL: String("https://api.github.com/repos/o/r/code-scanning/alerts/25"), + HTMLURL: String("https://github.com/o/r/security/code-scanning/25"), + MostRecentInstance: &MostRecentInstance{ + Ref: String("refs/heads/main"), + State: String("open"), + CommitSHA: String("abcdefg12345"), + Message: &Message{ + Text: String("This path depends on a user-provided value."), + }, + Location: &Location{ + Path: String("spec-main/api-session-spec.ts"), + StartLine: Int(917), + EndLine: Int(917), + StartColumn: Int(7), + EndColumn: Int(18), + }, + Classifications: []string{"test"}, + }, }, { RuleID: String("js/useless-expression"), RuleSeverity: String("warning"), RuleDescription: String("Expression has no effect"), Tool: &Tool{Name: String("CodeQL"), GUID: nil, Version: String("1.4.0")}, - CreatedAt: &date, - Open: Bool(true), - ClosedBy: nil, - ClosedAt: nil, - URL: String("https://api.github.com/repos/o/r/code-scanning/alerts/88"), - HTMLURL: String("https://github.com/o/r/security/code-scanning/88"), + Rule: &Rule{ + ID: String("js/useless-expression"), + Severity: String("warning"), + Description: String("Expression has no effect"), + Name: String("js/useless-expression"), + FullDescription: String("Expression has no effect"), + Help: String("Expression has no effect"), + }, + CreatedAt: &date, + Open: Bool(true), + ClosedBy: nil, + ClosedAt: nil, + URL: String("https://api.github.com/repos/o/r/code-scanning/alerts/88"), + HTMLURL: String("https://github.com/o/r/security/code-scanning/88"), + MostRecentInstance: &MostRecentInstance{ + Ref: String("refs/heads/main"), + State: String("open"), + CommitSHA: String("abcdefg12345"), + Message: &Message{ + Text: String("This path depends on a user-provided value."), + }, + Location: &Location{ + Path: String("spec-main/api-session-spec.ts"), + StartLine: Int(917), + EndLine: Int(917), + StartColumn: Int(7), + EndColumn: Int(18), + }, + Classifications: []string{"test"}, + }, }, } if !cmp.Equal(alerts, want) { @@ -161,6 +261,32 @@ func TestActionsService_GetAlert(t *testing.T) { "guid": null, "version": "1.4.0" }, + "rule": { + "id": "useless expression", + "severity": "warning", + "description": "Expression has no effect", + "name": "useless expression", + "full_description": "Expression has no effect", + "help": "Expression has no effect" + }, + "most_recent_instance": { + "ref": "refs/heads/main", + "state": "open", + "commit_sha": "abcdefg12345", + "message": { + "text": "This path depends on a user-provided value." + }, + "location": { + "path": "spec-main/api-session-spec.ts", + "start_line": 917, + "end_line": 917, + "start_column": 7, + "end_column": 18 + }, + "classifications": [ + "test" + ] + }, "created_at":"2019-01-02T15:04:05Z", "open":true, "closed_by":null, @@ -181,12 +307,36 @@ func TestActionsService_GetAlert(t *testing.T) { RuleSeverity: String("warning"), RuleDescription: String("Expression has no effect"), Tool: &Tool{Name: String("CodeQL"), GUID: nil, Version: String("1.4.0")}, - CreatedAt: &date, - Open: Bool(true), - ClosedBy: nil, - ClosedAt: nil, - URL: String("https://api.github.com/repos/o/r/code-scanning/alerts/88"), - HTMLURL: String("https://github.com/o/r/security/code-scanning/88"), + Rule: &Rule{ + ID: String("useless expression"), + Severity: String("warning"), + Description: String("Expression has no effect"), + Name: String("useless expression"), + FullDescription: String("Expression has no effect"), + Help: String("Expression has no effect"), + }, + CreatedAt: &date, + Open: Bool(true), + ClosedBy: nil, + ClosedAt: nil, + URL: String("https://api.github.com/repos/o/r/code-scanning/alerts/88"), + HTMLURL: String("https://github.com/o/r/security/code-scanning/88"), + MostRecentInstance: &MostRecentInstance{ + Ref: String("refs/heads/main"), + State: String("open"), + CommitSHA: String("abcdefg12345"), + Message: &Message{ + Text: String("This path depends on a user-provided value."), + }, + Location: &Location{ + Path: String("spec-main/api-session-spec.ts"), + StartLine: Int(917), + EndLine: Int(917), + StartColumn: Int(7), + EndColumn: Int(18), + }, + Classifications: []string{"test"}, + }, } if !cmp.Equal(alert, want) { t.Errorf("CodeScanning.GetAlert returned %+v, want %+v", alert, want) diff --git a/github/github-accessors.go b/github/github-accessors.go index 3dcb9a4e731..2d51bfdfb6e 100644 --- a/github/github-accessors.go +++ b/github/github-accessors.go @@ -172,6 +172,30 @@ func (a *Alert) GetCreatedAt() Timestamp { return *a.CreatedAt } +// GetDismissedAt returns the DismissedAt field if it's non-nil, zero value otherwise. +func (a *Alert) GetDismissedAt() Timestamp { + if a == nil || a.DismissedAt == nil { + return Timestamp{} + } + return *a.DismissedAt +} + +// GetDismissedBy returns the DismissedBy field. +func (a *Alert) GetDismissedBy() *User { + if a == nil { + return nil + } + return a.DismissedBy +} + +// GetDismissedReason returns the DismissedReason field if it's non-nil, zero value otherwise. +func (a *Alert) GetDismissedReason() string { + if a == nil || a.DismissedReason == nil { + return "" + } + return *a.DismissedReason +} + // GetHTMLURL returns the HTMLURL field if it's non-nil, zero value otherwise. func (a *Alert) GetHTMLURL() string { if a == nil || a.HTMLURL == nil { @@ -180,6 +204,22 @@ func (a *Alert) GetHTMLURL() string { return *a.HTMLURL } +// GetInstancesURL returns the InstancesURL field if it's non-nil, zero value otherwise. +func (a *Alert) GetInstancesURL() string { + if a == nil || a.InstancesURL == nil { + return "" + } + return *a.InstancesURL +} + +// GetMostRecentInstance returns the MostRecentInstance field. +func (a *Alert) GetMostRecentInstance() *MostRecentInstance { + if a == nil { + return nil + } + return a.MostRecentInstance +} + // GetOpen returns the Open field if it's non-nil, zero value otherwise. func (a *Alert) GetOpen() bool { if a == nil || a.Open == nil { @@ -188,6 +228,14 @@ func (a *Alert) GetOpen() bool { return *a.Open } +// GetRule returns the Rule field. +func (a *Alert) GetRule() *Rule { + if a == nil { + return nil + } + return a.Rule +} + // GetRuleDescription returns the RuleDescription field if it's non-nil, zero value otherwise. func (a *Alert) GetRuleDescription() string { if a == nil || a.RuleDescription == nil { @@ -7116,6 +7164,46 @@ func (l *ListRepositories) GetTotalCount() int { return *l.TotalCount } +// GetEndColumn returns the EndColumn field if it's non-nil, zero value otherwise. +func (l *Location) GetEndColumn() int { + if l == nil || l.EndColumn == nil { + return 0 + } + return *l.EndColumn +} + +// GetEndLine returns the EndLine field if it's non-nil, zero value otherwise. +func (l *Location) GetEndLine() int { + if l == nil || l.EndLine == nil { + return 0 + } + return *l.EndLine +} + +// GetPath returns the Path field if it's non-nil, zero value otherwise. +func (l *Location) GetPath() string { + if l == nil || l.Path == nil { + return "" + } + return *l.Path +} + +// GetStartColumn returns the StartColumn field if it's non-nil, zero value otherwise. +func (l *Location) GetStartColumn() int { + if l == nil || l.StartColumn == nil { + return 0 + } + return *l.StartColumn +} + +// GetStartLine returns the StartLine field if it's non-nil, zero value otherwise. +func (l *Location) GetStartLine() int { + if l == nil || l.StartLine == nil { + return 0 + } + return *l.StartLine +} + // GetEffectiveDate returns the EffectiveDate field if it's non-nil, zero value otherwise. func (m *MarketplacePendingChange) GetEffectiveDate() Timestamp { if m == nil || m.EffectiveDate == nil { @@ -7564,6 +7652,14 @@ func (m *MembershipEvent) GetTeam() *Team { return m.Team } +// GetText returns the Text field if it's non-nil, zero value otherwise. +func (m *Message) GetText() string { + if m == nil || m.Text == nil { + return "" + } + return *m.Text +} + // GetAction returns the Action field if it's non-nil, zero value otherwise. func (m *MetaEvent) GetAction() string { if m == nil || m.Action == nil { @@ -7892,6 +7988,62 @@ func (m *MilestoneStats) GetTotalMilestones() int { return *m.TotalMilestones } +// GetAnalysisKey returns the AnalysisKey field if it's non-nil, zero value otherwise. +func (m *MostRecentInstance) GetAnalysisKey() string { + if m == nil || m.AnalysisKey == nil { + return "" + } + return *m.AnalysisKey +} + +// GetCommitSHA returns the CommitSHA field if it's non-nil, zero value otherwise. +func (m *MostRecentInstance) GetCommitSHA() string { + if m == nil || m.CommitSHA == nil { + return "" + } + return *m.CommitSHA +} + +// GetEnvironment returns the Environment field if it's non-nil, zero value otherwise. +func (m *MostRecentInstance) GetEnvironment() string { + if m == nil || m.Environment == nil { + return "" + } + return *m.Environment +} + +// GetLocation returns the Location field. +func (m *MostRecentInstance) GetLocation() *Location { + if m == nil { + return nil + } + return m.Location +} + +// GetMessage returns the Message field. +func (m *MostRecentInstance) GetMessage() *Message { + if m == nil { + return nil + } + return m.Message +} + +// GetRef returns the Ref field if it's non-nil, zero value otherwise. +func (m *MostRecentInstance) GetRef() string { + if m == nil || m.Ref == nil { + return "" + } + return *m.Ref +} + +// GetState returns the State field if it's non-nil, zero value otherwise. +func (m *MostRecentInstance) GetState() string { + if m == nil || m.State == nil { + return "" + } + return *m.State +} + // GetBase returns the Base field if it's non-nil, zero value otherwise. func (n *NewPullRequest) GetBase() string { if n == nil || n.Base == nil { @@ -14164,6 +14316,54 @@ func (r *ReviewersRequest) GetNodeID() string { return *r.NodeID } +// GetDescription returns the Description field if it's non-nil, zero value otherwise. +func (r *Rule) GetDescription() string { + if r == nil || r.Description == nil { + return "" + } + return *r.Description +} + +// GetFullDescription returns the FullDescription field if it's non-nil, zero value otherwise. +func (r *Rule) GetFullDescription() string { + if r == nil || r.FullDescription == nil { + return "" + } + return *r.FullDescription +} + +// GetHelp returns the Help field if it's non-nil, zero value otherwise. +func (r *Rule) GetHelp() string { + if r == nil || r.Help == nil { + return "" + } + return *r.Help +} + +// GetID returns the ID field if it's non-nil, zero value otherwise. +func (r *Rule) GetID() string { + if r == nil || r.ID == nil { + return "" + } + return *r.ID +} + +// GetName returns the Name field if it's non-nil, zero value otherwise. +func (r *Rule) GetName() string { + if r == nil || r.Name == nil { + return "" + } + return *r.Name +} + +// GetSeverity returns the Severity field if it's non-nil, zero value otherwise. +func (r *Rule) GetSeverity() string { + if r == nil || r.Severity == nil { + return "" + } + return *r.Severity +} + // GetBusy returns the Busy field if it's non-nil, zero value otherwise. func (r *Runner) GetBusy() bool { if r == nil || r.Busy == nil { diff --git a/github/github-accessors_test.go b/github/github-accessors_test.go index e0be06149d7..86bb6c3ec67 100644 --- a/github/github-accessors_test.go +++ b/github/github-accessors_test.go @@ -180,6 +180,33 @@ func TestAlert_GetCreatedAt(tt *testing.T) { a.GetCreatedAt() } +func TestAlert_GetDismissedAt(tt *testing.T) { + var zeroValue Timestamp + a := &Alert{DismissedAt: &zeroValue} + a.GetDismissedAt() + a = &Alert{} + a.GetDismissedAt() + a = nil + a.GetDismissedAt() +} + +func TestAlert_GetDismissedBy(tt *testing.T) { + a := &Alert{} + a.GetDismissedBy() + a = nil + a.GetDismissedBy() +} + +func TestAlert_GetDismissedReason(tt *testing.T) { + var zeroValue string + a := &Alert{DismissedReason: &zeroValue} + a.GetDismissedReason() + a = &Alert{} + a.GetDismissedReason() + a = nil + a.GetDismissedReason() +} + func TestAlert_GetHTMLURL(tt *testing.T) { var zeroValue string a := &Alert{HTMLURL: &zeroValue} @@ -190,6 +217,23 @@ func TestAlert_GetHTMLURL(tt *testing.T) { a.GetHTMLURL() } +func TestAlert_GetInstancesURL(tt *testing.T) { + var zeroValue string + a := &Alert{InstancesURL: &zeroValue} + a.GetInstancesURL() + a = &Alert{} + a.GetInstancesURL() + a = nil + a.GetInstancesURL() +} + +func TestAlert_GetMostRecentInstance(tt *testing.T) { + a := &Alert{} + a.GetMostRecentInstance() + a = nil + a.GetMostRecentInstance() +} + func TestAlert_GetOpen(tt *testing.T) { var zeroValue bool a := &Alert{Open: &zeroValue} @@ -200,6 +244,13 @@ func TestAlert_GetOpen(tt *testing.T) { a.GetOpen() } +func TestAlert_GetRule(tt *testing.T) { + a := &Alert{} + a.GetRule() + a = nil + a.GetRule() +} + func TestAlert_GetRuleDescription(tt *testing.T) { var zeroValue string a := &Alert{RuleDescription: &zeroValue} @@ -8356,6 +8407,56 @@ func TestListRepositories_GetTotalCount(tt *testing.T) { l.GetTotalCount() } +func TestLocation_GetEndColumn(tt *testing.T) { + var zeroValue int + l := &Location{EndColumn: &zeroValue} + l.GetEndColumn() + l = &Location{} + l.GetEndColumn() + l = nil + l.GetEndColumn() +} + +func TestLocation_GetEndLine(tt *testing.T) { + var zeroValue int + l := &Location{EndLine: &zeroValue} + l.GetEndLine() + l = &Location{} + l.GetEndLine() + l = nil + l.GetEndLine() +} + +func TestLocation_GetPath(tt *testing.T) { + var zeroValue string + l := &Location{Path: &zeroValue} + l.GetPath() + l = &Location{} + l.GetPath() + l = nil + l.GetPath() +} + +func TestLocation_GetStartColumn(tt *testing.T) { + var zeroValue int + l := &Location{StartColumn: &zeroValue} + l.GetStartColumn() + l = &Location{} + l.GetStartColumn() + l = nil + l.GetStartColumn() +} + +func TestLocation_GetStartLine(tt *testing.T) { + var zeroValue int + l := &Location{StartLine: &zeroValue} + l.GetStartLine() + l = &Location{} + l.GetStartLine() + l = nil + l.GetStartLine() +} + func TestMarketplacePendingChange_GetEffectiveDate(tt *testing.T) { var zeroValue Timestamp m := &MarketplacePendingChange{EffectiveDate: &zeroValue} @@ -8859,6 +8960,16 @@ func TestMembershipEvent_GetTeam(tt *testing.T) { m.GetTeam() } +func TestMessage_GetText(tt *testing.T) { + var zeroValue string + m := &Message{Text: &zeroValue} + m.GetText() + m = &Message{} + m.GetText() + m = nil + m.GetText() +} + func TestMetaEvent_GetAction(tt *testing.T) { var zeroValue string m := &MetaEvent{Action: &zeroValue} @@ -9245,6 +9356,70 @@ func TestMilestoneStats_GetTotalMilestones(tt *testing.T) { m.GetTotalMilestones() } +func TestMostRecentInstance_GetAnalysisKey(tt *testing.T) { + var zeroValue string + m := &MostRecentInstance{AnalysisKey: &zeroValue} + m.GetAnalysisKey() + m = &MostRecentInstance{} + m.GetAnalysisKey() + m = nil + m.GetAnalysisKey() +} + +func TestMostRecentInstance_GetCommitSHA(tt *testing.T) { + var zeroValue string + m := &MostRecentInstance{CommitSHA: &zeroValue} + m.GetCommitSHA() + m = &MostRecentInstance{} + m.GetCommitSHA() + m = nil + m.GetCommitSHA() +} + +func TestMostRecentInstance_GetEnvironment(tt *testing.T) { + var zeroValue string + m := &MostRecentInstance{Environment: &zeroValue} + m.GetEnvironment() + m = &MostRecentInstance{} + m.GetEnvironment() + m = nil + m.GetEnvironment() +} + +func TestMostRecentInstance_GetLocation(tt *testing.T) { + m := &MostRecentInstance{} + m.GetLocation() + m = nil + m.GetLocation() +} + +func TestMostRecentInstance_GetMessage(tt *testing.T) { + m := &MostRecentInstance{} + m.GetMessage() + m = nil + m.GetMessage() +} + +func TestMostRecentInstance_GetRef(tt *testing.T) { + var zeroValue string + m := &MostRecentInstance{Ref: &zeroValue} + m.GetRef() + m = &MostRecentInstance{} + m.GetRef() + m = nil + m.GetRef() +} + +func TestMostRecentInstance_GetState(tt *testing.T) { + var zeroValue string + m := &MostRecentInstance{State: &zeroValue} + m.GetState() + m = &MostRecentInstance{} + m.GetState() + m = nil + m.GetState() +} + func TestNewPullRequest_GetBase(tt *testing.T) { var zeroValue string n := &NewPullRequest{Base: &zeroValue} @@ -16551,6 +16726,66 @@ func TestReviewersRequest_GetNodeID(tt *testing.T) { r.GetNodeID() } +func TestRule_GetDescription(tt *testing.T) { + var zeroValue string + r := &Rule{Description: &zeroValue} + r.GetDescription() + r = &Rule{} + r.GetDescription() + r = nil + r.GetDescription() +} + +func TestRule_GetFullDescription(tt *testing.T) { + var zeroValue string + r := &Rule{FullDescription: &zeroValue} + r.GetFullDescription() + r = &Rule{} + r.GetFullDescription() + r = nil + r.GetFullDescription() +} + +func TestRule_GetHelp(tt *testing.T) { + var zeroValue string + r := &Rule{Help: &zeroValue} + r.GetHelp() + r = &Rule{} + r.GetHelp() + r = nil + r.GetHelp() +} + +func TestRule_GetID(tt *testing.T) { + var zeroValue string + r := &Rule{ID: &zeroValue} + r.GetID() + r = &Rule{} + r.GetID() + r = nil + r.GetID() +} + +func TestRule_GetName(tt *testing.T) { + var zeroValue string + r := &Rule{Name: &zeroValue} + r.GetName() + r = &Rule{} + r.GetName() + r = nil + r.GetName() +} + +func TestRule_GetSeverity(tt *testing.T) { + var zeroValue string + r := &Rule{Severity: &zeroValue} + r.GetSeverity() + r = &Rule{} + r.GetSeverity() + r = nil + r.GetSeverity() +} + func TestRunner_GetBusy(tt *testing.T) { var zeroValue bool r := &Runner{Busy: &zeroValue}