STIX Interoperability Runner to write and validate STIX Interoperability Spec tests
The STIX Interoperability Runner is a Gherkin/Cucumber based testing platform for writing
and validating STIX interoperability scenarios and tests.
The runner provides gherkin syntax and cucumber steps to easily write meaningful and relevant STIX import, parse, manipulate, and validation features/scenarios.
Given the variance in the producers and consumers of STIX and the wide range of interoperability tests that are possible,
the runner provides a REST API for getting and submitting data during the tests. You can:
The purpose of this functionality is to allow those who are implementing the interoperability tests to choose how they want to validate:
By automating, we gain the ability to quickly validate all STIX content against the cost STIX Spec, and then write additional test steps based on the additional needs of interoperability.
This will drastically reduce the size of Interoperability Spec business text, and provide repeatable, testable, common set of objective evidence results for interoperability validation.
The runner will provide:
Run the Runner in com.github.stephenott.stix.interop.Runner
Feature: Simple Attack Pattern Imports
Scenario: Import and validate a Attack Pattern from a third-party System
Given a STIX JSON object at "/json/0_simple_object.json"
When I parse it as STIX
Then it must have property "key" as type "STRING"
Then it must be STIX type "attack-pattern"
When wait for take of object at "GET" "/scenario1"
When wait for submission of object at "POST" "/scenario1/update" as "sub1"
Then parse "sub1" as an "AttackPattern"
And "sub1" must have a different "created_by_ref" property
Then print the object
Then print parsed object "sub1"
Feature: Simple Attack Pattern Imports
Scenario: Import and validate a Attack Pattern from a third-party System # src/test/resources/features/0_simple_import.feature:3
Given a STIX JSON object at "/json/0_simple_object.json" # En.java:1004
When I parse it as STIX # En.java:1885
Then it must have property "key" as type "STRING" # En.java:1503
Then it must be STIX type "attack-pattern" # En.java:1463
Wiremock on localhost:8081
waiting for take at GET /scenario1
running action...CompleterId(id=f4348d3e-4020-489d-ab5b-cafe7767fc09)
class com.github.stephenott.stix.interop.glue.CompleterId
all done action
ALL DONE
When wait for take of object at "GET" "/scenario1" # En.java:1962
Wiremock on localhost:8081
waiting for submission at POST /scenario1/update
running action...CompleterId(id=e0d334ae-60f9-4618-9987-6e1f29ca95eb)
class com.github.stephenott.stix.interop.glue.CompleterId
all done action
submission with id: sub1 has body of: {
"key": "value",
"created_by_ref": "cats2",
"type": "attack-pattern"
}
ALL DONE
When wait for submission of object at "POST" "/scenario1/update" as "sub1" # En.java:2004
Then parse "sub1" as an "AttackPattern" # En.java:1503
And "sub1" must have a different "created_by_ref" property # En.java:126
{"key":"value","created_by_ref":"cats","type":"attack-pattern"}
Then print the object # En.java:1426
{"key":"value","created_by_ref":"cats2","type":"attack-pattern"}
Then print parsed object "sub1" # En.java:1463