1
0
mirror of https://github.com/SAP/jenkins-library.git synced 2024-12-14 11:03:09 +02:00

fix(cxone): fix test cases (#4564)

Co-authored-by: thtri <thanh.hai.trinh@sap.com>
This commit is contained in:
sumeet patil 2023-09-12 19:33:44 +05:30 committed by GitHub
parent 1704758563
commit 4de0e3e0f3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -75,13 +75,20 @@ func TestCreateJSONReport(t *testing.T) {
assert.Equal(t, "Incremental", reportingData.ScanType) assert.Equal(t, "Incremental", reportingData.ScanType)
lowList := (*reportingData.Findings)[2].LowPerQuery lowList := (*reportingData.Findings)[2].LowPerQuery
assert.Equal(t, 2, len(*lowList)) lowListLen := len(*lowList)
assert.Equal(t, "Low_Query_Name_1", (*lowList)[0].QueryName) assert.Equal(t, 2, lowListLen)
assert.Equal(t, 0, (*lowList)[0].Audited)
assert.Equal(t, 4, (*lowList)[0].Total) for i := 0; i < lowListLen; i++ {
assert.Equal(t, "Low_Query_Name_2", (*lowList)[1].QueryName) if (*lowList)[i].QueryName == "Low_Query_Name_1" {
assert.Equal(t, 5, (*lowList)[1].Audited) assert.Equal(t, 0, (*lowList)[i].Audited)
assert.Equal(t, 5, (*lowList)[1].Total) assert.Equal(t, 4, (*lowList)[i].Total)
}
if (*lowList)[i].QueryName == "Low_Query_Name_2" {
assert.Equal(t, 5, (*lowList)[i].Audited)
assert.Equal(t, 5, (*lowList)[i].Total)
}
}
lowPerQuery = map[string]map[string]int{} lowPerQuery = map[string]map[string]int{}
submap = map[string]int{} submap = map[string]int{}