Skip to content

Commit

Permalink
Rename to StatusesCounters
Browse files Browse the repository at this point in the history
Signed-off-by: David Wertenteil <[email protected]>
  • Loading branch information
David Wertenteil committed Feb 6, 2023
1 parent f144cee commit d67682a
Show file tree
Hide file tree
Showing 6 changed files with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ func (controlSummary *ControlSummary) NumberOfResources() ICounters {
}

// NumberOfResources get the status counters
func (controlSummary *ControlSummary) ResourcesCounters() (ICounters, ISubCounters) {
func (controlSummary *ControlSummary) StatusesCounters() (ICounters, ISubCounters) {
return &controlSummary.StatusCounters, &controlSummary.SubStatusCounters
}

Expand Down
1 change: 0 additions & 1 deletion reporthandling/results/v1/reportsummary/datastructures.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ type ControlSummary struct {
SubStatusCounters SubStatusCounters `json:",inline"`
Score float32 `json:"score"`
ScoreFactor float32 `json:"scoreFactor"`
// SubStatus apis.ScanningSubStatus `json:"subStatus"`
}

type StatusCounters struct {
Expand Down
2 changes: 1 addition & 1 deletion reporthandling/results/v1/reportsummary/interface.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ type IControlSummary interface {
// Get SubStatus() get control sub status
GetSubStatus() apis.ScanningSubStatus

ResourcesCounters() (ICounters, ISubCounters)
StatusesCounters() (ICounters, ISubCounters)
}

type IControlsSummaries interface {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ func TestUpdateControlsSummaryCountersFailed(t *testing.T) {
}

for _, v := range controls {
statuses, subStatuses := v.ResourcesCounters()
statuses, subStatuses := v.StatusesCounters()
assert.Equal(t, 1, statuses.All())
assert.Equal(t, 1, statuses.Failed())
assert.Equal(t, 0, statuses.Passed())
Expand All @@ -89,7 +89,7 @@ func TestUpdateControlsSummaryCountersExcluded(t *testing.T) {

updateControlsSummaryCounters(&mockResultsException, controls, nil)
for _, v := range controls {
statuses, subStatuses := v.ResourcesCounters()
statuses, subStatuses := v.StatusesCounters()
assert.Equal(t, 1, statuses.All())
assert.Equal(t, 0, statuses.Failed())
assert.Equal(t, 1, statuses.Passed())
Expand Down

0 comments on commit d67682a

Please sign in to comment.