Fluent Commerce Logo
Docs

By Type

400 Items

Integration Tests with the Connect SDK

How-to Guide
  • End-to-End Test Orchestration: You will learn how to wire, configure, and execute automated integration tests using specialized Connect SDK test modules (`connect-sdk-test-core`, `connect-sdk-test-core-aws`, and `connect-sdk-test-core-kafka`) to validate custom data handlers against simulated API footprints and containerized queue systems.
  • Execution Command Restrictions: Standard unit test triggers like `mvn test` will completely ignore these integration suites. You must invoke the pipeline using `mvn clean integration-test` and explicitly declare or preset the targeted active Spring profiles (such as `aws,localstack` or `kafka`) to instantiate the proper environment dependencies and messaging beans.
  • Isolated Bootstrapping Requirements: When building integration tests inside a decoupled code module that lacks a primary application runner, you must manually deploy an executable bootstrap class annotated with `@SpringBootApplication` and `@EnableScheduling` inside your `src/test/java` directory. Additionally, you must place three mandatory configuration manifests (`application.yml`, `application-connector.yml`, and `bootstrap.yml`) into the `src/test/resources` folder.
  • Automated Environment Isolation: The test suite leverages `Testcontainers` and `WireMock` to manage external asset lifecycles dynamically. Activating specific environment flags like `localstack` inside the configuration settings instructs the SDK to auto-provision localized mock instances of cloud services (including Amazon SQS queues, Amazon S3 buckets, and secrets vaults), eliminating the need to manage external persistent test infrastructure.