diff --git a/pkg/hubtest/coverage.go b/pkg/hubtest/coverage.go index 570750b8e..ad7ceff63 100644 --- a/pkg/hubtest/coverage.go +++ b/pkg/hubtest/coverage.go @@ -20,12 +20,12 @@ type Coverage struct { } func (h *HubTest) GetWaapCoverage() ([]Coverage, error) { - if _, ok := h.HubIndex.Items[cwhub.WAAP_RULES]; !ok { + if len(h.HubIndex.GetItemMap(cwhub.WAAP_RULES)) == 0 { return nil, fmt.Errorf("no waap rules in hub index") } // populate from hub, iterate in alphabetical order - pkeys := sortedMapKeys(h.HubIndex.Items[cwhub.WAAP_RULES]) + pkeys := sortedMapKeys(h.HubIndex.GetItemMap(cwhub.WAAP_RULES)) coverage := make([]Coverage, len(pkeys)) for i, name := range pkeys { @@ -165,7 +165,7 @@ func (h *HubTest) GetParsersCoverage() ([]Coverage, error) { } func (h *HubTest) GetScenariosCoverage() ([]Coverage, error) { - if len(h.HubIndex.GetItemMap(cwhub.SCENARIOS)) == 0 { + if len(h.HubIndex.GetItemMap(cwhub.SCENARIOS)) == 0 { return nil, fmt.Errorf("no scenarios in hub index") } diff --git a/pkg/hubtest/hubtest_item.go b/pkg/hubtest/hubtest_item.go index e59fa72e9..90cd3bd02 100644 --- a/pkg/hubtest/hubtest_item.go +++ b/pkg/hubtest/hubtest_item.go @@ -320,7 +320,7 @@ func (t *HubTestItem) InstallHub() error { continue } - if hubWaapRule, ok := t.HubIndex.Items[cwhub.WAAP_RULES][waaprule]; ok { + if hubWaapRule, ok := t.HubIndex.GetItemMap(cwhub.WAAP_RULES)[waaprule]; ok { waapRuleSource, err := filepath.Abs(filepath.Join(t.HubPath, hubWaapRule.RemotePath)) if err != nil { return fmt.Errorf("can't get absolute path of '%s': %s", waapRuleSource, err)