---
title: "Testing"
description: "Test Inttegro API integrations locally with contract validation, deterministic outcomes, isolated state, and controlled failures."
canonical: "https://studio.inttegro.dev/api/testing"
format: inttegro-machine-docs/v1
language: "cURL"
reader_profile: optional
reader_manifest: "https://studio.inttegro.dev/machine/curl/readers/index.json"
reader_identification: "Optional: declare your client only if known and your current-session capabilities; use reader_manifest for supplemental recommendations."
preamble_estimated_tokens: 427
model_token_report: "https://studio.inttegro.dev/machine/token-report.json"
preamble_questions: 5
preamble_source: "general"
recommended_mcp_tools: []
estimated_tokens: 3161
token_estimate_method: "utf8_bytes_divided_by_4"
---

## Machine preamble

**Summary:** Test Inttegro API integrations locally with contract validation, deterministic outcomes, isolated state, and controlled failures. This cURL representation preserves HTTP paths and JSON wire names.

### Five questions

#### Q1. When should the reader use Testing?

Use this API reference when exact operations, fields, states, or errors are required.

#### Q2. What is authoritative on this page?

Use the documented HTTP operation, JSON names, validation rules, and public error contract. Do not substitute SDK names into the wire request.

#### Q3. What page-specific constraint matters most?

Prioritize the machine-only guidance “Keep test and production boundaries explicit”: Point the existing integration at the emulator. Make the Inttegro base URL configurable; do not add a second set of request models or test-only API calls. Use only credentials issued by the local profile. Simile credentials are synthetic…

#### Q4. Can Inttegro MCP materially help with this task?

No catalog ability is sufficiently specific to recommend for this page. Use the documentation directly; consult the MCP catalog only if the task later requires governed live account context or a supported operation.

#### Q5. How should the reader verify the answer and continue?

For a read, compare the returned resource with the requested identifier and scope. For a write, preserve its identifier and retrieve authoritative current state before declaring the business outcome complete. Continue with [Idempotent requests](https://studio.inttegro.dev/machine/curl/api/idempotency.md) and [Errors](https://studio.inttegro.dev/machine/curl/api/errors.md) when those concerns enter scope.

## Document content

# Testing

Inttegro publishes a Simile service that runs the public API contract on your
machine or in CI. Use it to test requests, responses, authentication, stateful
workflows, exact error outcomes, and retry behavior without sending a request
to the production API.

## Keep test and production boundaries explicit

- **Point the existing integration at the emulator.** Make the Inttegro base
  URL configurable; do not add a second set of request models or test-only API
  calls.
- **Use only credentials issued by the local profile.** Simile credentials are
  synthetic and valid only for the emulator. Never copy an Inttegro production
  key into a local test command, fixture, log, or CI variable.
- **Select exact outcomes when the assertion depends on one result.** Named
  scenarios are stable test inputs. Unselected schema synthesis is useful for
  broader contract coverage, but it is not a promise that one particular
  business outcome will be chosen.
- **Keep production verification separate.** Local emulation proves the
  published contract and declared behavior. It does not reproduce private risk
  decisions, provider networks, production latency, or the state of an
  Inttegro account.
- **Report contradictions instead of coding around them.** If Simile accepts
  something Inttegro rejects, rejects something Inttegro accepts, or returns a
  public outcome that conflicts with this documentation, preserve the smallest
  reproduction and submit an inconsistency report. That evidence lets us fix
  the published contract or emulator for every integrator.

## What the testing service represents

The published Inttegro Simfile composes the OpenAPI contract with public test
behavior. OpenAPI owns routes, request and response schemas, field rules, error
shapes, and cross-field soundness constraints. The accompanying Simile modules
add observable behavior that an HTTP schema cannot express by itself, including
test principals, named outcomes, persistent state effects, asynchronous work,
and controlled delivery faults.

Your application still sends ordinary Inttegro HTTP requests. The differences
are the base URL and bearer credential: both come from the local Simile profile
instead of an Inttegro production account. Keeping those values configurable
lets the same integration code run locally, in CI, and against Inttegro without
maintaining a separate test client.

This is a provider-authored contract emulator, not a shared sandbox. Test state
belongs to the local Simile service, so one developer or CI job does not depend
on another account's records, execution order, or availability.

## Testing mechanisms

| Mechanism                      | What to test                                                                  | What it establishes                                                                                           |
| ------------------------------ | ----------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- |
| Contract validation            | Required fields, formats, alternatives, bounds, and cross-field relationships | The request is accepted by the published Inttegro contract and the response conforms to one declared outcome. |
| Authentication profiles        | Active, revoked, and expired local credentials                                | The integration sends bearer credentials correctly and handles authentication failure without exposing a key. |
| Named scenarios                | Exact successes and documented domain errors                                  | The test reaches the intended public outcome instead of relying on random response synthesis.                 |
| Stateful workflows             | Create, update, lookup, page, and reset sequences                             | Later requests observe the public consequences declared for earlier requests.                                 |
| Idempotency and lost responses | Replay the same logical write after a response is lost                        | Retry code reuses one stable key and does not duplicate a committed operation.                                |
| Fault profiles                 | Bounded latency and delivery failures                                         | Timeouts, backoff, cancellation, and recovery behave as expected under controlled failure.                    |
| Isolated profiles              | Separate local applications and test runs                                     | Credentials and state do not leak between tests that require independent setup.                               |

These mechanisms are complementary. Schema validation catches malformed
requests, but it cannot prove that your code handles a declined payment. A
named decline scenario reaches that outcome, but it does not prove safe retry
behavior after a network interruption. Build the suite from the public behavior
your integration depends on rather than treating one successful request as
complete coverage.

## Report contract inconsistencies

The local test service is part of Inttegro's public integration contract. If
its observable behavior contradicts the API documentation or the production
API, please report it rather than adding an emulator-specific workaround. In
particular, report cases where:

- the emulator accepts a request that the documented API rejects, or rejects a
  documented request;
- a response has the wrong status, error code, shape, field relationship, or
  state transition;
- a named scenario does not produce its documented public outcome; or
- a stored resource cannot be retrieved or updated as the public workflow
  describes.

Simile can capture a self-contained reproduction, verify it locally, remove
recognized secrets, and let you review the report before it is sent. Automatic
reporting is optional and profile-scoped; leaving it off does not prevent you
from preparing and sending a one-off report. Never include production
credentials or real customer data in a reproduction.

Follow [Report an inconsistency](https://studio.inttegro.dev/machine/curl/guides/test-with-simile.md#report-an-inconsistency)
for the Inttegro workflow, or read Simile's
[issue-reporting guide](https://os.inttegro.dev/simile/issue-reporting) for the
complete consent, evidence, and submission model.

## Structure an integration test

Start each independent suite with a known profile and state boundary. Load the
profile's base URL and synthetic key through environment variables, then run
the same client code your application uses outside tests.

For each workflow:

1. Send a representative valid request and assert the response fields your
   application actually consumes.
2. Retrieve or page the resulting resource when the workflow depends on a
   later request observing the write.
3. Select documented error scenarios and assert both the HTTP status and the
   public error tuple your recovery code uses.
4. Send malformed requests to verify that validation failures stop the
   workflow before any stateful consequence occurs.
5. For an idempotent write, simulate a lost response and repeat the same
   operation with the same payload and key.
6. Reset or replace the profile before a test that requires an empty account.

Prefer assertions about public behavior: status, response shape, documented
fields, resource state, and retry semantics. Do not make a test depend on
Simile's storage layout, internal collection names, or an implementation detail
that is absent from the Inttegro contract.

## Use deterministic outcomes deliberately

When a test needs a specific public result, start the service with the named
scenario for that result. Inttegro's published scenarios cover reviewed
successes and failures such as invalid payment methods, refund cancellation
failures, expired upload requests, and a response lost after an idempotent
write commits.

Without a selected scenario, Simile can synthesize any response alternative
allowed by the operation. That is useful for contract exploration and broad
payload coverage. It is not appropriate for a test whose expected branch must
remain stable. Keep scenario selection in the test harness so production code
does not know that the emulator exists.

## Know what requires another test boundary

The local service validates the contract Inttegro publishes and emulates the
public behavior declared with it. It cannot prove behavior outside that
boundary, including:

- production credentials, account configuration, or historical data;
- private fraud, compliance, or provider-routing decisions;
- mobile money, banking, email, SMS, or object-storage provider availability;
- production latency, capacity, DNS, and network paths; or
- the customer experience in your deployed browser or mobile application.

Before releasing, also test your own deployed application, secret injection,
redirect handling, reconciliation, observability, and user interface. Use the
local emulator for repeatable API coverage; use production-readiness checks for
the infrastructure and providers that only exist outside it.

## Run the service

Follow [Test with Simile](https://studio.inttegro.dev/machine/curl/guides/test-with-simile.md) for the complete setup and
walkthrough. It covers installing Simile, downloading Inttegro's published
contract bundle, creating a local application profile, calling public and
authenticated operations, selecting scenarios and faults, and isolating or
resetting state.

## Related resources

- [Test with Simile](https://studio.inttegro.dev/machine/curl/guides/test-with-simile.md) - Install and run the published Inttegro test service.
- [Authentication](https://studio.inttegro.dev/machine/curl/api/authentication.md) - Send bearer credentials without moving the trust boundary.
- [Errors](https://studio.inttegro.dev/machine/curl/api/errors.md) - Handle public error responses consistently.
- [Idempotent requests](https://studio.inttegro.dev/machine/curl/api/idempotency.md) - Retry write operations without duplicating work.
