Skip to content

Commit

Permalink
rename safeJavaCode as the example has a secret key
Browse files Browse the repository at this point in the history
  • Loading branch information
jacksingleton committed Mar 3, 2017
1 parent 6b6d06b commit 0c8148d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions detector/filecontent_detector_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)}

Expand Down Expand Up @@ -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])

}
}

0 comments on commit 0c8148d

Please sign in to comment.