-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci(java): migrate to annotations (#305)
- Loading branch information
Showing
75 changed files
with
598 additions
and
2,560 deletions.
There are no files selected for viewing
44 changes: 0 additions & 44 deletions
44
tests/java/lang/cookie_missing_http_only/__snapshots__/test.js.snap
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,40 @@ | ||
const { createInvoker, createNewInvoker, getEnvironment } = require("../../../helper.js") | ||
const { | ||
createNewInvoker, | ||
getEnvironment, | ||
} = require("../../../helper.js") | ||
const { ruleId, ruleFile, testBase } = getEnvironment(__dirname) | ||
|
||
describe(ruleId, () => { | ||
const invoke = createInvoker(ruleId, ruleFile, testBase); | ||
const invoke = createNewInvoker(ruleId, ruleFile, testBase) | ||
|
||
test("bad", () => { | ||
const testCase = "bad.java" | ||
expect(invoke(testCase)).toMatchSnapshot(); | ||
}) | ||
|
||
test("bad", () => { | ||
const testCase = "bad.java" | ||
|
||
const results = invoke(testCase) | ||
|
||
test("ok", () => { | ||
const testCase = "ok.java" | ||
expect(invoke(testCase)).toMatchSnapshot(); | ||
}) | ||
expect(results.Missing).toEqual([]) | ||
expect(results.Extra).toEqual([]) | ||
}) | ||
|
||
|
||
// new invoker | ||
const invokeV2 = createNewInvoker(ruleId, ruleFile, testBase) | ||
test("main", () => { | ||
const testCase = "main.java" | ||
|
||
test("missing_http_only", () => { | ||
const testCase = "main.java" | ||
const results = invoke(testCase) | ||
|
||
const results = invokeV2(testCase) | ||
expect(results.Missing).toEqual([]) | ||
expect(results.Extra).toEqual([]) | ||
}) | ||
|
||
|
||
expect(results.Missing).toEqual([]) | ||
expect(results.Extra).toEqual([]) | ||
}) | ||
test("ok", () => { | ||
const testCase = "ok.java" | ||
|
||
const results = invoke(testCase) | ||
|
||
expect(results.Missing).toEqual([]) | ||
expect(results.Extra).toEqual([]) | ||
}) | ||
|
||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
44 changes: 0 additions & 44 deletions
44
tests/java/lang/cookie_missing_secure/__snapshots__/test.js.snap
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,40 @@ | ||
const { createInvoker, createNewInvoker, getEnvironment } = require("../../../helper.js") | ||
const { | ||
createNewInvoker, | ||
getEnvironment, | ||
} = require("../../../helper.js") | ||
const { ruleId, ruleFile, testBase } = getEnvironment(__dirname) | ||
|
||
describe(ruleId, () => { | ||
const invoke = createInvoker(ruleId, ruleFile, testBase) | ||
const invoke = createNewInvoker(ruleId, ruleFile, testBase) | ||
|
||
|
||
test("bad", () => { | ||
const testCase = "bad.java" | ||
|
||
test("bad", () => { | ||
const testCase = "bad.java" | ||
expect(invoke(testCase)).toMatchSnapshot(); | ||
}) | ||
const results = invoke(testCase) | ||
|
||
expect(results.Missing).toEqual([]) | ||
expect(results.Extra).toEqual([]) | ||
}) | ||
|
||
|
||
test("ok", () => { | ||
const testCase = "ok.java" | ||
expect(invoke(testCase)).toMatchSnapshot(); | ||
}) | ||
test("main", () => { | ||
const testCase = "main.java" | ||
|
||
// new invoker | ||
const invokeV2 = createNewInvoker(ruleId, ruleFile, testBase) | ||
const results = invoke(testCase) | ||
|
||
test("missing_http_only", () => { | ||
const testCase = "main.java" | ||
expect(results.Missing).toEqual([]) | ||
expect(results.Extra).toEqual([]) | ||
}) | ||
|
||
|
||
const results = invokeV2(testCase) | ||
test("ok", () => { | ||
const testCase = "ok.java" | ||
|
||
expect(results.Missing).toEqual([]) | ||
expect(results.Extra).toEqual([]) | ||
}) | ||
const results = invoke(testCase) | ||
|
||
expect(results.Missing).toEqual([]) | ||
expect(results.Extra).toEqual([]) | ||
}) | ||
|
||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
44 changes: 0 additions & 44 deletions
44
tests/java/lang/file_permission_others/__snapshots__/test.js.snap
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,30 @@ | ||
const { createInvoker, getEnvironment } = require("../../../helper.js") | ||
const { | ||
createNewInvoker, | ||
getEnvironment, | ||
} = require("../../../helper.js") | ||
const { ruleId, ruleFile, testBase } = getEnvironment(__dirname) | ||
|
||
describe(ruleId, () => { | ||
const invoke = createInvoker(ruleId, ruleFile, testBase) | ||
const invoke = createNewInvoker(ruleId, ruleFile, testBase) | ||
|
||
|
||
test("ok", () => { | ||
const testCase = "ok.java" | ||
|
||
const results = invoke(testCase) | ||
|
||
test("ok", () => { | ||
const testCase = "ok.java" | ||
expect(invoke(testCase)).toMatchSnapshot(); | ||
}) | ||
expect(results.Missing).toEqual([]) | ||
expect(results.Extra).toEqual([]) | ||
}) | ||
|
||
|
||
test("others", () => { | ||
const testCase = "others.java" | ||
expect(invoke(testCase)).toMatchSnapshot(); | ||
}) | ||
test("others", () => { | ||
const testCase = "others.java" | ||
|
||
const results = invoke(testCase) | ||
|
||
expect(results.Missing).toEqual([]) | ||
expect(results.Extra).toEqual([]) | ||
}) | ||
|
||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
46 changes: 0 additions & 46 deletions
46
tests/java/lang/hardcoded_database_password/__snapshots__/test.js.snap
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.