Integration Testing with the New B2C Commerce Connector

Info: This feature in Bloomreach Content requires a standard or premium license. Contact Bloomreach for details.

Overview

After you have validated your CommerceRepository implementations and completed unit testing using the Commerce Connector SDK APIs, you must perform integration testing with the Bloomreach Commerce Accelerator Application. To do this, add your connector module as a dependency and configure it within the Bloomreach B2C Commerce Accelerator project.

Info: Refer to the Installation documentation to install and create a Bloomreach B2C Commerce Accelerator project.

Add the Commerce Connector Module Dependency

Add your Commerce Connector Module as a dependency in the cms-dependencies/pom.xml file of your Bloomreach B2C Commerce Accelerator project. For example, to use the B2C Demo Commerce Connector Module:

<dependency> <groupId>com.bloomreach.commercedxp.demo.connectors</groupId> <artifactId>mydemoconnector-b2c</artifactId> <version>14.1.0</version> </dependency>

Build and Start the Accelerator

Build the Bloomreach B2C Commerce Accelerator project:

$ mvn clean verify -Ddependency-check.skip=true

Start the application:

$ mvn -P cargo.run

After the application starts, register your B2C Commerce Connector Module using a configuration document.

Register the Connector

Register the new B2C Commerce Connector Module by creating a Commerce Connector document in the CMS:

  1. Navigate to the adminitration/commerce-connectors folder.
  2. Create a new Commerce Connector document. For example, use "mydemo" as the name for the B2C Demo Commerce Connector Module.

New Commerce Connector document dialog with name mydemo entered

  1. In the Connector ID field, enter "mydemo". This value uniquely identifies the connector.
  2. In the Module Name field, enter the module name specified in the module descriptor at META-INF/hst-assembly/addon/module.xml. For the demo connector, use com.bloomreach.commercedxp.demo.connectors.mydemoconnector.
  3. Leave the Resource space field empty if you are not using the CRISP API. If you use CRISP API in your connector, specify the resource space name here.

Bloomreach content editor showing mydemo commerce connector settings

  1. Publish the Commerce Connector document. The new connector module "mydemo" is now active in the system.

Bloomreach XM commerce-connectors document with mydemo connector selected

Set the Default Connector for the Channel

To use your connector as the default for a channel:

  1. Open Experience manager and edit the channel settings.
  2. In the Bloomreach Commerce Accelerator channel settings, select "mydemo" as the default Commerce Connector.
  3. Publish the channel to apply the configuration.
  4. Disable the Bloomreach APIs to ensure the connector is used.

Channel settings showing mydemo connector and BloomReach APIs enabled

Access the Delivery Application

Open the delivery tier application at http://localhost:8080/site/. Select the Product Grid menu. The product grid page displays product data from the B2C Demo Commerce Connector Module.

Product grid page with commerce items in Bloomreach site

Test Customer Sign-up

Test the customer sign-up and sign-in features:

  1. Click the Login link.
  2. On the login page, click the Sign up link.

The B2C Demo Commerce Connector Module stores data in memory only. Customer and cart data are not persisted. You must sign up again after each server restart before signing in.

Sign Up form with name, email, and password fields

Test Customer Sign-in

After signing up, sign in with your credentials.

Bloomreach sign-in page with email and password fields

Verify Product Grid as Authenticated User

Return to the Product Grid page. The data remains the same, but you are now recognized as an authenticated customer.

Product grid page showing authenticated user and product tiles

Click a product item in the grid to access the product detail page.

Test Product Detail Page and Add to Cart

On the product detail page, add the product to your cart.

Product detail page with T-shirt image, price, and Add to Cart

Select the Cart menu to view, update, or delete cart entries.

Verification

  • The product grid displays data from your connector.
  • Customer sign-up and sign-in work as expected.
  • Cart functionality operates with in-memory data.

Troubleshooting

  • If data is missing after a server restart, sign up again. The demo connector does not persist data.
  • Ensure the connector is registered and selected as the default in channel settings.
  • Disable Bloomreach APIs to avoid conflicts with the connector.
Share Feedback
Page: /frontend/commerce-accelerator/overview-setup/integration-testing-with-new-b2c-commerce-connector
Section: Frontend
Category *
Integration Testing with New B2C Commerce Connector | Bloomreach Content Documentation