coldbox-testing-integration

Run ColdBox integration tests with real handlers, services, and databases.

1|Updated Apr 10, 2026
One-click install
npx skills add https://github.com/ColdBox/skills --skill coldbox-testing-integration
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: coldbox-testing-integration
Source: https://github.com/ColdBox/skills/tree/main/coldbox/testing-integration
Command: npx skills add https://github.com/ColdBox/skills --skill coldbox-testing-integration

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Integration testing in ColdBox requires executing real handlers, services, and database operations which is time-consuming to configure and easy to make nondeterministic; this skill documents patterns to run reliable end-to-end tests that exercise the full ColdBox stack without relying on mocks.

Core Features & Use Cases

  • Full request-cycle execution: run handlers and API endpoints via execute() with renderResults and assert response codes and payloads.
  • Real dependency testing: obtain actual WireBox-injected services and verify persistence and inter-service interactions.
  • Database lifecycle patterns: setup and teardown test data, use dedicated test datasources, and adopt transaction rollback or targeted cleanup to keep tests isolated.
  • Use Case: verify a user registration flows through the handler stack, returns 201, and persists the user record in the test database.

Quick Start

Run an integration test that executes the users.register event through ColdBox, asserts a 201 response, and verifies the user record exists in the test database.

Frequently Asked Questions about coldbox-testing-integration

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I run integration tests in ColdBox that execute real handlers and services?

ColdBox integration tests use the BaseTestCase execute() method to run full request cycles, exercising real handlers and WireBox-injected services against an actual database without relying on mocks. You can assert response codes and payloads directly from the renderResults output.

What's the best way to isolate database state during ColdBox end-to-end testing?

To isolate database state during ColdBox end-to-end testing, use a dedicated test datasource and apply transaction rollback or targeted delete patterns in your setup and teardown methods. This ensures deterministic database cleanup and prevents test data from affecting other tests.

How do I test WireBox dependency injection in a ColdBox integration test?

You can test WireBox dependency injection by obtaining actual injected services during the BaseTestCase request cycle. This allows you to verify real persistence and inter-service interactions rather than mocking dependencies.

Can I verify response payloads and HTTP status codes using ColdBox BaseTestCase?

Yes, you can verify response payloads and HTTP status codes by executing handler and API endpoints via the BaseTestCase execute() method. It returns a renderResults-based response object that allows you to assert specific response codes like 201 and validate the returned data structure.

Does ColdBox integration testing require a specific datasource configuration?

ColdBox integration testing requires a dedicated test datasource configuration to ensure deterministic database setup and cleanup. This isolates your test data from development or production databases and supports transaction rollback or targeted cleanup patterns.

Why use transaction rollback instead of mocks for ColdBox database testing?

Transaction rollback provides deterministic database setup and cleanup for ColdBox database testing by reverting changes after each test, whereas mocks bypass real database operations. Using rollback ensures your tests exercise actual persistence layers and inter-service interactions for true end-to-end coverage.