diff --git a/pkg/analysis/analysis_test.go b/pkg/analysis/analysis_test.go index c3ec32c921..c4c75d122a 100644 --- a/pkg/analysis/analysis_test.go +++ b/pkg/analysis/analysis_test.go @@ -3,9 +3,10 @@ package analysis import ( "encoding/json" "fmt" + "testing" + "github.com/k8sgpt-ai/k8sgpt/pkg/analyzer" "github.com/stretchr/testify/require" - "testing" ) func TestAnalysis_NoProblemJsonOutput(t *testing.T) { @@ -42,11 +43,12 @@ func TestAnalysis_ProblemJsonOutput(t *testing.T) { analysis := Analysis{ Results: []analyzer.Result{ { - "Deployment", - "test-deployment", - []string{"test-problem"}, - "test-solution", - "parent-resource"}, + Kind: "Deployment", + Name: "test-deployment", + Error: []string{"test-problem"}, + Details: "test-solution", + ParentObject: "parent-resource", + }, }, Namespace: "default", } @@ -55,11 +57,13 @@ func TestAnalysis_ProblemJsonOutput(t *testing.T) { Status: StateProblemDetected, Problems: 1, Results: []analyzer.Result{ - {"Deployment", - "test-deployment", - []string{"test-problem"}, - "test-solution", - "parent-resource"}, + { + Kind: "Deployment", + Name: "test-deployment", + Error: []string{"test-problem"}, + Details: "test-solution", + ParentObject: "parent-resource", + }, }, } @@ -84,11 +88,12 @@ func TestAnalysis_MultipleProblemJsonOutput(t *testing.T) { analysis := Analysis{ Results: []analyzer.Result{ { - "Deployment", - "test-deployment", - []string{"test-problem", "another-test-problem"}, - "test-solution", - "parent-resource"}, + Kind: "Deployment", + Name: "test-deployment", + Error: []string{"test-problem", "another-test-problem"}, + Details: "test-solution", + ParentObject: "parent-resource", + }, }, Namespace: "default", } @@ -97,11 +102,13 @@ func TestAnalysis_MultipleProblemJsonOutput(t *testing.T) { Status: StateProblemDetected, Problems: 2, Results: []analyzer.Result{ - {"Deployment", - "test-deployment", - []string{"test-problem", "another-test-problem"}, - "test-solution", - "parent-resource"}, + { + Kind: "Deployment", + Name: "test-deployment", + Error: []string{"test-problem", "another-test-problem"}, + Details: "test-solution", + ParentObject: "parent-resource", + }, }, }