From b26aa17e6fb5aa16344a4b7cefb097a6a5236d4c Mon Sep 17 00:00:00 2001 From: Abdul Basit Date: Wed, 11 Dec 2024 22:22:24 +0500 Subject: [PATCH] [Fix] detector's integration tests starting with alphabet 'e' & 'f' (#3764) * edamam detector test fixed * fix ftp detector test --- pkg/detectors/edamam/edamam_integration_test.go | 4 ++++ pkg/detectors/ftp/ftp_integration_test.go | 10 +++++++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/pkg/detectors/edamam/edamam_integration_test.go b/pkg/detectors/edamam/edamam_integration_test.go index 016daa6d4d90..af09b26d7caa 100644 --- a/pkg/detectors/edamam/edamam_integration_test.go +++ b/pkg/detectors/edamam/edamam_integration_test.go @@ -96,6 +96,10 @@ func TestEdamam_FromChunk(t *testing.T) { t.Fatalf("no raw secret present: \n %+v", got[i]) } got[i].Raw = nil + if len(got[i].RawV2) == 0 { + t.Fatalf("no raw v2 secret present: \n %+v", got[i]) + } + got[i].RawV2 = nil } if diff := pretty.Compare(got, tt.want); diff != "" { t.Errorf("Edamam.FromData() %s diff: (-got +want)\n%s", tt.name, diff) diff --git a/pkg/detectors/ftp/ftp_integration_test.go b/pkg/detectors/ftp/ftp_integration_test.go index 80982dc07a5d..ce4a3db33ede 100644 --- a/pkg/detectors/ftp/ftp_integration_test.go +++ b/pkg/detectors/ftp/ftp_integration_test.go @@ -121,7 +121,15 @@ func TestFTP_FromChunk(t *testing.T) { data: []byte("ftp://abc:123@ftp.freebsd.org/pub/FreeBSD/doc/tr/articles/explaining-bsd/explaining-bsd_tr.pdf"), verify: true, }, - wantErr: false, + want: []detectors.Result{ + { + DetectorType: detectorspb.DetectorType_FTP, + Verified: false, + Redacted: "ftp://abc:********@ftp.freebsd.org", + }, + }, + wantErr: false, + wantVerificationErr: true, }, } for _, tt := range tests {