33 lines
1.3 KiB
Plaintext
33 lines
1.3 KiB
Plaintext
[[Testing Framework Cheatsheet]]
|
|
= Testing
|
|
|
|
[partintro]
|
|
|
|
Elasticsearch and Shield use jUnit for testing, they also use randomness
|
|
in the tests, that can be set using a seed, please refer to the
|
|
Elasticsearch TESTING.asciidoc cheatsheet to know all about it.
|
|
|
|
Tests are executed with network transport and unicast discovery, as this is
|
|
the configuration that's secured by shield.
|
|
|
|
== Testing the REST layer
|
|
|
|
The available integration tests are specific for Shield functionalities
|
|
and make use of the java API to communicate with the elasticsearch nodes,
|
|
using the internal binary transport (port 9300 by default).
|
|
Shield is also tested using the REST tests provided by Elasticsearch core,
|
|
just by running those same tests against a cluster with Shield installed.
|
|
|
|
The REST tests are not run automatically when executing the maven test
|
|
command just yet (they are run with the regular suite when -Dtests.slow=true
|
|
is supplied). Some tests are blacklisted as they are known to fail against
|
|
shield due to different behaviours introduced by the security plugin.
|
|
|
|
---------------------------------------------------------------------------
|
|
mvn test -Dtests.filter="@Rest"
|
|
---------------------------------------------------------------------------
|
|
|
|
`ShieldRestTests` is the executable test class that runs all the
|
|
yaml suites available within the `rest-api-spec` folder.
|
|
|