Since implementing the role based access model an extensive configuration of user privileges is required to actually exercise the services through their REST APIs. This makes JUnit testing through the APIs cumbersome, and due to the breakup of the database transactions to provide and clean up test data, this was error-prone anyway.
The JUnit tests shall therefore be rewritten so that
All REST calls are replaced by direct calls to the class method;
All indirect REST calls (i. e. Ingestor calling Storage Manager and Production Planner) shall be caught by mocked services inside the JUnit test implementation instead of relying on external mockups like CastleMock;
For the SecurityManager class a mockup test class shall be written, which always returns true on security checks.
Where needed services shall be rewritten to make them testable in this way.
All unit tests work as expected without external services. Where needed, an internal simulation of external services has been implemented. Issue closed.
Since implementing the role based access model an extensive configuration of user privileges is required to actually exercise the services through their REST APIs. This makes JUnit testing through the APIs cumbersome, and due to the breakup of the database transactions to provide and clean up test data, this was error-prone anyway.
The JUnit tests shall therefore be rewritten so that
Where needed services shall be rewritten to make them testable in this way.