Skip to content

Commit 547f00c

Browse files
committed
Refactor Spring test
1 parent 9631b65 commit 547f00c

File tree

1 file changed

+8
-10
lines changed
  • java/ql/test/library-tests/frameworks/spring/controller

1 file changed

+8
-10
lines changed

java/ql/test/library-tests/frameworks/spring/controller/test.ql

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,18 @@ import java
22
import semmle.code.java.dataflow.FlowSources
33
import TestUtilities.InlineFlowTest
44

5-
class EnableLegacy extends EnableLegacyConfiguration {
6-
EnableLegacy() { exists(this) }
7-
}
8-
9-
class ValueFlowConf extends DataFlow::Configuration {
10-
ValueFlowConf() { this = "ValueFlowConf" }
11-
12-
override predicate isSource(DataFlow::Node source) { source instanceof RemoteFlowSource }
5+
module ValueFlowConfig implements DataFlow::ConfigSig {
6+
predicate isSource(DataFlow::Node source) { source instanceof RemoteFlowSource }
137

14-
override predicate isSink(DataFlow::Node sink) {
8+
predicate isSink(DataFlow::Node sink) {
159
sink.asExpr().(Argument).getCall().getCallee().hasName("sink")
1610
}
1711
}
1812

13+
module ValueFlow = DataFlow::Global<ValueFlowConfig>;
14+
1915
class Test extends InlineFlowTest {
20-
override DataFlow::Configuration getValueFlowConfig() { result = any(ValueFlowConf config) }
16+
override predicate hasValueFlow(DataFlow::Node src, DataFlow::Node sink) {
17+
ValueFlow::flow(src, sink)
18+
}
2119
}

0 commit comments

Comments
 (0)