1
0
mirror of https://github.com/SAP/jenkins-library.git synced 2024-12-12 10:55:20 +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)
lowList := (*reportingData.Findings)[2].LowPerQuery
assert.Equal(t, 2, len(*lowList))
assert.Equal(t, "Low_Query_Name_1", (*lowList)[0].QueryName)
assert.Equal(t, 0, (*lowList)[0].Audited)
assert.Equal(t, 4, (*lowList)[0].Total)
assert.Equal(t, "Low_Query_Name_2", (*lowList)[1].QueryName)
assert.Equal(t, 5, (*lowList)[1].Audited)
assert.Equal(t, 5, (*lowList)[1].Total)
lowListLen := len(*lowList)
assert.Equal(t, 2, lowListLen)
for i := 0; i < lowListLen; i++ {
if (*lowList)[i].QueryName == "Low_Query_Name_1" {
assert.Equal(t, 0, (*lowList)[i].Audited)
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{}
submap = map[string]int{}