# Testing
source: https://developer.mastercard.com/mdes-pre-digitization/documentation/testing/index.md

As the Pre-Digitization API is an outbound API from Mastercard, there is no Sandbox environment available for testing. We recommend you do an offline testing using the guidance provided in this document.

## What Is Offline Testing? {#what-is-offline-testing}

Offline testing allows issuers integrating with the Pre-Digitization API to validate their implementation entirely within their own environment, without connecting to Mastercard systems. This testing is performed prior to integration testing (such as MTF) and focuses on validating encryption, payload structure, and overall request flow.
Note: Offline testing will not establish the transport layer communication between MDES and the Issuer system.

## Is it mandatory? {#is-it-mandatory}

Mastercard recommends you conduct the offline testing with results being sent to your CIS IM. These are some of the benefits:

* **Early validation \& risk reduction**: Validates API structure, payloads, and encryption upfront, minimizing integration issues and rework in later stages.

* **Issuer-led, environment-independent testing**: Executed using issuer systems, keys, and endpoints; eliminating reliance on sandbox availability.

* **Proof of readiness for onboarding**: Generates clear evidence to support progression to higher environments and onboarding review.

Note: Offline testing simulates how the issuer system receives request and send response back to Mastercard. It does not establish the transport layer communication with Mastercard.

![Offline Testing](https://static.developer.mastercard.com/content/mdes-pre-digitization/documentation/img/offline-testing-flow.png)

## Process {#process}

![Process](https://static.developer.mastercard.com/content/mdes-pre-digitization/documentation/img/process.png)

1. Download the [project](https://developer.mastercard.com/mdes-pre-digitization/documentation/testing/end-point-selection/index.md) files.
2. Prepare your [data](https://developer.mastercard.com/mdes-pre-digitization/documentation/testing/test-data-prep/index.md) based on the guidelines provided.
3. Execute the [tests](https://developer.mastercard.com/mdes-pre-digitization/documentation/testing/execution-flow/index.md).
4. Submit the [test results](https://developer.mastercard.com/mdes-pre-digitization/documentation/testing/submit-test-result/index.md) to Mastercard.

## Pre-Requisite {#pre-requisite}

* Understanding of Pre-Digitization API documentation.
* Working Key management process to generate and manage encryption keys that are required:
  * Key pair generated (Public and Private Keys) and stored in keystore file (.P12 format)
  * Encryption Certificate in .crt format

Note: The Keystore and Mastercard encryption certificates that are generated and downloaded at the time of project creation can be used for this testing.

## Tools Required {#tools-required}

The following tools are required to perform offline testing:

* **Insomnia API Client** : Used to import sample requests, configure environments, and execute test scenarios. Please use the latest version of [Insomnia](https://insomnia.rest) to ensure compatibility with the Mastercard Plugin.
* **Mastercard Encryption Plugin for Insomnia** : Used to encrypt request payloads according to MDES specifications. Follow the instructions [here](https://developer.mastercard.com/platform/documentation/developer-tools/insomnia-collection/) to extract the content of the zip file in the Plugins folder.
* **Issuer Encryption Libraries** (optional): Issuer-owned cryptographic libraries or HSMs for payload encryption and key management.
* **Issuer's Test Endpoint**: A local or internal endpoint capable of receiving outbound Pre-Digitization API requests from Mastercard.

## Expected Outcome {#expected-outcome}

Offline testing is considered successful when:

* All test scenarios execute successfully.
* Encrypted payloads meet the documented format.
* Issuer system meets the specification
* Evidence is captured and shared with the CIS partner
