diff --git a/detector/filecontent_detector_test.go b/detector/filecontent_detector_test.go index eff501f0..2c8ae0c6 100644 --- a/detector/filecontent_detector_test.go +++ b/detector/filecontent_detector_test.go @@ -76,9 +76,9 @@ func TestShouldFlagPotentialJWT(t *testing.T) { } func TestShouldFlagPotentialSecretsWithinJavaCode(t *testing.T) { - const safeJavaCode string = "public class HelloWorld {\r\n\r\n public static void main(String[] args) {\r\n // Prints \"Hello, World\" to the terminal window.\r\n accessKey=\"wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY\";\r\n System.out.println(\"Hello, World\");\r\n }\r\n\r\n}" + const dangerousJavaCode string = "public class HelloWorld {\r\n\r\n public static void main(String[] args) {\r\n // Prints \"Hello, World\" to the terminal window.\r\n accessKey=\"wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY\";\r\n System.out.println(\"Hello, World\");\r\n }\r\n\r\n}" results := NewDetectionResults() - content := []byte(safeJavaCode) + content := []byte(dangerousJavaCode) filename := "filename" additions := []git_repo.Addition{git_repo.NewAddition(filename, content)} @@ -137,4 +137,4 @@ func TestResultsShouldContainBase64TextsIfHexAndBase64ExistInFile(t *testing.T) expectedMsg := "Expected file to not to contain base64 or hex encoded texts such as: " + base64 assert.Equal(t, expectedMsg, results.Failures(filePath)[1]) -} \ No newline at end of file +}