# Integration and Testing
source: https://developer.mastercard.com/commercial-event-notifications/documentation/integration-and-testing/index.md

## Ready to Begin Testing? {#ready-to-begin-testing}

Tip: We recommend that you begin testing in the Sandbox.

Once you have created a project on Mastercard Developers and generated Sandbox
credentials, you can start testing. If you have not done this yet, complete
the [Quick Start Guide](https://developer.mastercard.com/commercial-event-notifications/documentation/quick-start-guide/index.md)
first.

### Base URLs for Testing {#base-urls-for-testing}

* Sandbox
* Production

```xml
https://sandbox.api.mastercard.com/commercial-event-notifications/
```

```xml
https://api.mastercard.com/commercial-event-notifications/
```

## Testing Workflow {#testing-workflow}

Follow these steps to test your integration end to end:

1. Choose a testing method from the list below and configure OAuth 1.0a signing for your Sandbox consumer key.
2. Run the ordered workflow on the [Testing](https://developer.mastercard.com/commercial-event-notifications/documentation/testing/index.md) page: get field mappings, create a subscription, verify it, update it, retrieve notifications, and delete it.
3. Run the positive test cases and confirm the expected status codes and response fields.
4. Run the negative test cases and confirm the expected `ReasonCode` values.
5. If a result does not match, look up the reason code in [Codes and Formats](https://developer.mastercard.com/commercial-event-notifications/documentation/codeandformats/index.md) and apply its resolution step.

## Test Cases {#test-cases}

The [Testing](https://developer.mastercard.com/commercial-event-notifications/documentation/testing/index.md) page holds the test
cases for each endpoint family:

| Endpoint family |                                       Positive test                                       |                               Negative test                               |
|-----------------|-------------------------------------------------------------------------------------------|---------------------------------------------------------------------------|
| FieldMapping    | `GET /fieldmappings` returns `200 OK` and field mapping records.                          | An unauthorized consumer key returns `403` with `subscriber.not.allowed`. |
| Subscription    | `POST /subscriptions` returns `201 Created` with a generated `id`.                        | A missing `subjectType` returns `400` with `invalid.data`.                |
| Notifications   | `GET /notifications` with `start` and `end` returns `200 OK` and a `notifications` array. | A missing `start` returns `400` with `parameter.start.missing`.           |

## Methods of Testing {#methods-of-testing}

### 1. Reference Application {#1-reference-application}

> * Our Spring Boot reference application acts as an API client and runs every operation in the end-to-end flow.
> * For detailed steps, follow our [Reference Application](https://developer.mastercard.com/commercial-event-notifications/documentation/developer-tools/reference_application_tutorial/index.md) tutorial.

### 2. Postman {#2-postman}

> * Postman is an API client that you can use to test API calls in the Sandbox and Production environments without writing code. You can run individual requests, a folder, or the entire collection.
> * To fork the collection and configure OAuth 1.0a signing, follow our [Postman Collection](https://developer.mastercard.com/commercial-event-notifications/documentation/developer-tools/postman-collection/index.md) page.

### 3. Insomnia {#3-insomnia}

> * [Insomnia](https://insomnia.rest/) is an open-source API client for sending REST requests to Mastercard APIs. API Consultancy \& Standards developed an [Insomnia plugin](https://github.com/Mastercard/insomnia-plugin-mastercard) that handles API authentication.
> * Follow our [Insomnia tutorial](https://developer.mastercard.com/platform/tutorial/use-insomnia-rest-client-for-mastercard-apis/) to learn how to test the Commercial Event Notifications API using Insomnia.

## Next Steps {#next-steps}

* Run the test cases on the [Testing](https://developer.mastercard.com/commercial-event-notifications/documentation/testing/index.md) page.
* Download the [Reference Application](https://developer.mastercard.com/commercial-event-notifications/documentation/developer-tools/reference_application_tutorial/index.md) to see a typical use of the Commercial Event Notifications API.
* Use [Codes and Formats](https://developer.mastercard.com/commercial-event-notifications/documentation/codeandformats/index.md) to look up error codes and their resolution steps.
