mirror of
https://github.com/empayre/fleet.git
synced 2024-11-06 17:05:18 +00:00
765031d962
If the same vulnerability was present in more than one software, then duplicated third party integration calls were being issued.
34 lines
740 B
Go
34 lines
740 B
Go
package webhooks
|
|
|
|
import (
|
|
"net/url"
|
|
"testing"
|
|
|
|
"github.com/fleetdm/fleet/v4/server/fleet"
|
|
"github.com/fleetdm/fleet/v4/server/ptr"
|
|
"github.com/stretchr/testify/require"
|
|
)
|
|
|
|
func TestGetPaylaod(t *testing.T) {
|
|
serverURL, err := url.Parse("http://mywebsite.com")
|
|
require.NoError(t, err)
|
|
|
|
vuln := fleet.SoftwareVulnerability{
|
|
CVE: "cve-1",
|
|
SoftwareID: 1,
|
|
}
|
|
meta := fleet.CVEMeta{
|
|
CVE: "cve-1",
|
|
CVSSScore: ptr.Float64(1),
|
|
EPSSProbability: ptr.Float64(0.5),
|
|
CISAKnownExploit: ptr.Bool(true),
|
|
}
|
|
|
|
sut := Mapper{}
|
|
|
|
result := sut.GetPayload(serverURL, nil, vuln.CVE, meta)
|
|
require.Empty(t, result.CISAKnownExploit)
|
|
require.Empty(t, result.EPSSProbability)
|
|
require.Empty(t, result.CVSSScore)
|
|
}
|