Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
jswoods committed Sep 3, 2024
1 parent a9d3160 commit 4916d34
Showing 1 changed file with 8 additions and 17 deletions.
25 changes: 8 additions & 17 deletions pkg/humio/client_mock.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,29 +39,24 @@ var (
type resourceKey struct {
// clusterName holds the value of the cluster
clusterName string

// searchDomainName is the name of the repository or view
searchDomainName string

// resourceName is the name of resource, like IngestToken, Parser, etc.
resourceName string
}

type ClientMock struct {
OnPremLicense map[resourceKey]humioapi.OnPremLicense

Repository map[resourceKey]humioapi.Repository
View map[resourceKey]humioapi.View

OnPremLicense map[resourceKey]humioapi.OnPremLicense
Repository map[resourceKey]humioapi.Repository
View map[resourceKey]humioapi.View
IngestToken map[resourceKey]humioapi.IngestToken
Parser map[resourceKey]humioapi.Parser
Action map[resourceKey]humioapi.Action
Alert map[resourceKey]humioapi.Alert
FilterAlert map[resourceKey]humioapi.FilterAlert
AggregateAlert map[resourceKey]humioapi.AggregateAlert
ScheduledSearch map[resourceKey]humioapi.ScheduledSearch

User humioapi.User
User humioapi.User
}

type MockClientConfig struct {
Expand All @@ -71,20 +66,17 @@ type MockClientConfig struct {
func NewMockClient() *MockClientConfig {
mockClientConfig := &MockClientConfig{
apiClient: &ClientMock{
OnPremLicense: make(map[resourceKey]humioapi.OnPremLicense),

Repository: make(map[resourceKey]humioapi.Repository),
View: make(map[resourceKey]humioapi.View),

OnPremLicense: make(map[resourceKey]humioapi.OnPremLicense),
Repository: make(map[resourceKey]humioapi.Repository),
View: make(map[resourceKey]humioapi.View),
IngestToken: make(map[resourceKey]humioapi.IngestToken),
Parser: make(map[resourceKey]humioapi.Parser),
Action: make(map[resourceKey]humioapi.Action),
Alert: make(map[resourceKey]humioapi.Alert),
FilterAlert: make(map[resourceKey]humioapi.FilterAlert),
AggregateAlert: make(map[resourceKey]humioapi.AggregateAlert),
ScheduledSearch: make(map[resourceKey]humioapi.ScheduledSearch),

User: humioapi.User{},
User: humioapi.User{},
},
}

Expand Down Expand Up @@ -942,7 +934,6 @@ func (h *MockClientConfig) ClearHumioClientConnections(repoNameToKeep string) {
}
}
h.apiClient.View = make(map[resourceKey]humioapi.View)

h.apiClient.IngestToken = make(map[resourceKey]humioapi.IngestToken)
h.apiClient.Parser = make(map[resourceKey]humioapi.Parser)
h.apiClient.Action = make(map[resourceKey]humioapi.Action)
Expand Down

0 comments on commit 4916d34

Please sign in to comment.