What problem does it solve?
Provides a concise, repeatable approach for unit testing ColdBox interceptor CFCs in complete isolation without booting a full ColdBox application, reducing test flakiness and setup overhead.
Core Features & Use Cases
- Pre-wired mocks: Supplies ready-to-use mockController, mockRequestService, mockLogger, mockLogBox, and mockFlash for rapid test development.
- Direct interception testing: Call interception points (preProcess, postProcess, onException, custom announce points) directly on the interceptor instance to assert behavior and side effects.
- Configurable interceptor properties: Set configProperties before super.setup() and inject mock collaborators via prepareMock or property injection to simulate dependencies.
- Scaffolding support: Use provided CommandBox generators to scaffold interceptors and their unit tests quickly.
Quick Start
Create a unit test that extends BaseInterceptorTest, set configProperties before setup, inject any required mocks, invoke the desired interception point on variables.interceptor with a mocked request context, and assert interactions on the mocks.