mirror of
https://github.com/github/codeql.git
synced 2026-05-04 13:15:21 +02:00
Java: Rewrite inline expectation tests to use parameterized module
This commit is contained in:
@@ -3,12 +3,10 @@ import semmle.code.java.dataflow.DataFlow
|
||||
import semmle.code.java.security.XPathInjectionQuery
|
||||
import TestUtilities.InlineExpectationsTest
|
||||
|
||||
class HasXPathInjectionTest extends InlineExpectationsTest {
|
||||
HasXPathInjectionTest() { this = "HasXPathInjectionTest" }
|
||||
module HasXPathInjectionTest implements TestSig {
|
||||
string getARelevantTag() { result = "hasXPathInjection" }
|
||||
|
||||
override string getARelevantTag() { result = "hasXPathInjection" }
|
||||
|
||||
override predicate hasActualResult(Location location, string element, string tag, string value) {
|
||||
predicate hasActualResult(Location location, string element, string tag, string value) {
|
||||
tag = "hasXPathInjection" and
|
||||
exists(DataFlow::Node sink | XPathInjectionFlow::flowTo(sink) |
|
||||
sink.getLocation() = location and
|
||||
@@ -17,3 +15,5 @@ class HasXPathInjectionTest extends InlineExpectationsTest {
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
import MakeTest<HasXPathInjectionTest>
|
||||
|
||||
Reference in New Issue
Block a user