diff --git a/checks/fileparser/listing.go b/checks/fileparser/listing.go index aab72e085c5..3efb8208991 100644 --- a/checks/fileparser/listing.go +++ b/checks/fileparser/listing.go @@ -52,7 +52,9 @@ func isMatchingPath(fullpath string, matchPathTo PathMatcher) (bool, error) { func isTestdataFile(fullpath string) bool { // testdata/ or /some/dir/testdata/some/other return strings.HasPrefix(fullpath, "testdata/") || - strings.Contains(fullpath, "/testdata/") + strings.Contains(fullpath, "/testdata/") || + strings.HasPrefix(fullpath, "src/test/") || + strings.Contains(fullpath, "/src/test/") } // PathMatcher represents a query for a filepath. diff --git a/checks/fileparser/listing_test.go b/checks/fileparser/listing_test.go index 0c55518d223..7d3e7cbfacb 100644 --- a/checks/fileparser/listing_test.go +++ b/checks/fileparser/listing_test.go @@ -375,6 +375,13 @@ func Test_isTestdataFile(t *testing.T) { }, want: true, }, + { + name: "testdata file", + args: args{ + fullpath: "archiva-modules/archiva-base/archiva-checksum/src/test/resources/examples/redback-authz-open.jar", + }, + want: true, + }, } for _, tt := range tests { tt := tt // Re-initializing variable so it is not changed while executing the closure below