The code SpringContextLoader is pretty handy, but is only usable if you normally use Spring's default ContextLoader. If your app already has its own custom subclass of ContextLoader, the only way to use this code to have RESTEasy discover your endpoints is to copy/paste the code into your custom context loader.
A solution (that is included in the patch) is to extract all that code into a class with no superclass; the code in question doesn't rely on the fact that it's inside a subclass of ContextLoader.
This new class can then be used to get the functionality, but without forcing me to use the RESTEasy subclass of ContextLoader.
- Changes described
- Tests (written first) that cover the current version of SpringContextLoader. After extracting the code to SpringContextLoaderSupport (feel free to come up with a better name), the tests still pass.