Java: Rewrite inline expectation tests to use parameterized module

This commit is contained in:
Jeroen Ketema
2023-06-05 16:54:08 +02:00
parent 97c4f497bc
commit 49993b023e
132 changed files with 466 additions and 336 deletions

View File

@@ -2,12 +2,10 @@ import java
import semmle.code.java.security.InsecureBasicAuthQuery
import TestUtilities.InlineExpectationsTest
class HasInsecureBasicAuthTest extends InlineExpectationsTest {
HasInsecureBasicAuthTest() { this = "HasInsecureBasicAuthTest" }
module HasInsecureBasicAuthTest implements TestSig {
string getARelevantTag() { result = "hasInsecureBasicAuth" }
override string getARelevantTag() { result = "hasInsecureBasicAuth" }
override predicate hasActualResult(Location location, string element, string tag, string value) {
predicate hasActualResult(Location location, string element, string tag, string value) {
tag = "hasInsecureBasicAuth" and
exists(DataFlow::Node sink | InsecureBasicAuthFlow::flowTo(sink) |
sink.getLocation() = location and
@@ -16,3 +14,5 @@ class HasInsecureBasicAuthTest extends InlineExpectationsTest {
)
}
}
import MakeTest<HasInsecureBasicAuthTest>