mardi 17 avril 2018

Integration testing with and without SSL

I'm trying to ensure that my spark java app has 100% code coverage for our testing suite.

The application main class takes a config file that lets the user configure some application specific data, along with the spark port and whether to enable SSL and the accompanying keystore and truststore.

All of my tests work as expected when run in isolation, with perfect code coverage. However, when running the tests all at once, the order of the tests matters. If the test that configures spark for SSL via the secure method is called early in the testing process, then all the future tests that are used without SSL will fail. If the SSL test is run last then all tests work perfect.

Since there is no way to choose the order the tests are run, I was hoping to be able to disable the Spark secure call, but there is no way to do that. Further, since Spark is operating on a static instance, there is no way to clear out it's values. So once secure is enabled, it is enabled for all tests.

Any help or guidance on how to unsecure Spark would be greatly appreciated.

Thanks in advance.

Aucun commentaire:

Enregistrer un commentaire