Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
Signed-off-by: Ivan Milchev <ivan@mondoo.com>
  • Loading branch information
imilchev committed Apr 19, 2024
1 parent 5c4243b commit c1fd676
Showing 1 changed file with 76 additions and 0 deletions.
76 changes: 76 additions & 0 deletions policy/evidence_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,10 @@ func TestGenerateEvidenceControlMap(t *testing.T) {
{Uid: "query1"},
{Uid: "query2"},
},
Controls: []*ControlRef{
{Uid: "control1"},
{Uid: "control2"},
},
},
},
}
Expand All @@ -68,6 +72,10 @@ func TestGenerateEvidenceControlMap(t *testing.T) {
{Uid: "query1"},
{Uid: "query2"},
},
Controls: []*ControlRef{
{Uid: "control1"},
{Uid: "control2"},
},
}
require.Equal(t, expected, cm)
})
Expand All @@ -88,6 +96,10 @@ func TestGenerateEvidenceControlMap(t *testing.T) {
{Mrn: "query1"},
{Mrn: "query2"},
},
Controls: []*ControlRef{
{Mrn: "control1"},
{Mrn: "control2"},
},
},
},
}
Expand All @@ -103,6 +115,10 @@ func TestGenerateEvidenceControlMap(t *testing.T) {
{Mrn: "query1"},
{Mrn: "query2"},
},
Controls: []*ControlRef{
{Mrn: "control1"},
{Mrn: "control2"},
},
}
require.Equal(t, expected, cm)
})
Expand All @@ -123,6 +139,10 @@ func TestGenerateEvidenceControlMap(t *testing.T) {
{Uid: "query1"},
{Uid: "query2"},
},
Controls: []*ControlRef{
{Uid: "control1"},
{Uid: "control2"},
},
},
{
Uid: "evidence-uid-2",
Expand All @@ -136,6 +156,10 @@ func TestGenerateEvidenceControlMap(t *testing.T) {
{Uid: "query3"},
{Uid: "query4"},
},
Controls: []*ControlRef{
{Uid: "control3"},
{Uid: "control4"},
},
},
},
}
Expand All @@ -155,6 +179,12 @@ func TestGenerateEvidenceControlMap(t *testing.T) {
{Uid: "query3"},
{Uid: "query4"},
},
Controls: []*ControlRef{
{Uid: "control1"},
{Uid: "control2"},
{Uid: "control3"},
{Uid: "control4"},
},
}
require.Equal(t, expected, cm)
})
Expand Down Expand Up @@ -197,6 +227,10 @@ func TestGenerateEvidenceFrameworkMap(t *testing.T) {
{Uid: "query1"},
{Uid: "query2"},
},
Controls: []*ControlRef{
{Uid: "control1"},
{Uid: "control2"},
},
},
},
}
Expand Down Expand Up @@ -228,6 +262,10 @@ func TestGenerateEvidenceFrameworkMap(t *testing.T) {
{Uid: "query1"},
{Uid: "query2"},
},
Controls: []*ControlRef{
{Uid: "control1"},
{Uid: "control2"},
},
},
},
PolicyDependencies: []*explorer.ObjectRef{{Uid: "policy-uid"}},
Expand All @@ -249,6 +287,9 @@ func TestGenerateEvidenceFrameworkMap(t *testing.T) {
Queries: []*explorer.Mquery{
{Mrn: "query2"},
},
Controls: []*ControlRef{
{Mrn: "control2"},
},
},
},
}
Expand Down Expand Up @@ -278,6 +319,9 @@ func TestGenerateEvidenceFrameworkMap(t *testing.T) {
Queries: []*ControlRef{
{Mrn: "query2"},
},
Controls: []*ControlRef{
{Mrn: "control2"},
},
},
},
}
Expand All @@ -300,6 +344,10 @@ func TestGenerateEvidenceFrameworkMap(t *testing.T) {
{Uid: "query1"},
{Mrn: "query2"},
},
Controls: []*ControlRef{
{Uid: "control1"},
{Mrn: "control2"},
},
},
},
}
Expand Down Expand Up @@ -331,6 +379,10 @@ func TestGenerateEvidenceFrameworkMap(t *testing.T) {
{Uid: "query1"},
{Mrn: "query2"},
},
Controls: []*ControlRef{
{Uid: "control1"},
{Mrn: "control2"},
},
},
},
PolicyDependencies: []*explorer.ObjectRef{{Uid: "policy-uid"}},
Expand All @@ -354,6 +406,10 @@ func TestGenerateEvidenceFrameworkMap(t *testing.T) {
{Uid: "query1"},
{Uid: "query2"},
},
Controls: []*ControlRef{
{Uid: "control1"},
{Uid: "control2"},
},
},
{
Uid: "evidence-uid-2",
Expand All @@ -367,6 +423,10 @@ func TestGenerateEvidenceFrameworkMap(t *testing.T) {
{Uid: "query3"},
{Uid: "query4"},
},
Controls: []*ControlRef{
{Uid: "control3"},
{Uid: "control4"},
},
},
},
}
Expand All @@ -385,6 +445,10 @@ func TestGenerateEvidenceFrameworkMap(t *testing.T) {
{Uid: "query5"},
{Uid: "query6"},
},
Controls: []*ControlRef{
{Uid: "control5"},
{Uid: "control6"},
},
},
},
}
Expand Down Expand Up @@ -418,6 +482,12 @@ func TestGenerateEvidenceFrameworkMap(t *testing.T) {
{Uid: "query3"},
{Uid: "query4"},
},
Controls: []*ControlRef{
{Uid: "control1"},
{Uid: "control2"},
{Uid: "control3"},
{Uid: "control4"},
},
},
{
Uid: "control-uid-2",
Expand All @@ -429,6 +499,10 @@ func TestGenerateEvidenceFrameworkMap(t *testing.T) {
{Uid: "query5"},
{Uid: "query6"},
},
Controls: []*ControlRef{
{Uid: "control5"},
{Uid: "control6"},
},
},
},
PolicyDependencies: []*explorer.ObjectRef{{Uid: "policy-uid"}},
Expand Down Expand Up @@ -775,6 +849,7 @@ func TestGenerateEvidenceObjects(t *testing.T) {
{Uid: "query1"},
{Uid: "query2"},
},
Controls: []*ControlRef{},
},
},
PolicyDependencies: []*explorer.ObjectRef{{Uid: "framework-uid-evidence-policy"}},
Expand Down Expand Up @@ -830,6 +905,7 @@ func TestGenerateEvidenceObjects(t *testing.T) {
Queries: []*ControlRef{
{Mrn: "query1"},
},
Controls: []*ControlRef{},
},
},
}
Expand Down

0 comments on commit c1fd676

Please sign in to comment.