SMM API Integration Tests: A Fixture Checklist Before Launch

An SMM API integration is ready for a controlled connection check when its client behaviour is predictable on both ordinary responses and inconvenient ones. Test the boundaries first: an item with missing fields, an unsupported service type, a mixed batch, an unfamiliar status and a creation attempt whose outcome cannot be established.

Use synthetic fixtures to make those cases repeatable without placing orders. The goal is a release record that says what the application accepted, rejected or held for review, with evidence for each decision. A test suite should expose its limits as clearly as its passes.

This guide provides an original twelve-case manifest, two small JSON fixtures and a Python runner. All IDs, values and response faults are DEMO. The runner performs no network requests and needs no API key. It passed all twelve local cases during preparation of this article. Public AlwaysCompleted and OWASP documentation was reviewed on 26 November 2026; no authenticated connection or real order was tested.

Define the slice your application supports

Write down the actions, service types and response fields your first release actually uses. A client that supports a Default order form should not accept every catalogue entry simply because it has a service ID. The public API reference documents different input fields for different service types and includes mixed batch responses. Use the relevant contract rather than assuming every action has one universal shape.

For the teaching suite, the supported purchasing slice is deliberately small: a Default-style local form with a target and quantity. The catalogue parser can observe another type, but the local purchase gate holds it as unsupported. This demonstrates a useful distinction between being able to display data and being able to execute the associated operation correctly.

Include the parts your application does not support in the release record. A limitation that is visible and enforced can be a reasonable first release. A hidden limitation becomes a defect when a customer can select a service the client cannot submit properly.

Assign an owner to each supported boundary. The person responsible for parsing a status response may differ from the person responsible for quote validation or worker recovery. The manifest should make those responsibilities visible before an issue reaches a customer.

Keep fixtures small enough to understand

A useful fixture contains just enough data to exercise a decision. Give each object a clearly synthetic identifier and an explanatory filename. Keep source-contract facts separate from the invented values, so nobody mistakes a sample rate or status history for an observed account result.

The two downloads contain three fictional services and a two-item status batch. The test runner derives fault variants in memory: it removes a required field, repeats an ID, introduces an unsupported value and omits a requested result. The original fixture files remain unchanged.

Avoid copying a complete private response into a shared repository. Small synthetic examples are easier to review and carry no customer targets or account secrets. If a real defect later requires a regression fixture, reduce and sanitise it, document which property of the defect must survive, and retain sensitive original evidence only in the appropriate restricted system.

Name the expected client behaviour before writing the assertion. “Does not crash” is too weak for an ambiguous creation result. A useful expectation says that the result is held, no external ID is invented and no automatic second creation is attempted.

Validate meaning as well as JSON syntax

A response can be valid JSON and still be unusable. OWASP's validation guidance recommends checking field structure and the relationships that make values meaningful. Apply that principle at the boundary between external data and your own offer or order logic.

For example, the fixture runner rejects a catalogue item without a service ID and a catalogue with repeated IDs. It checks quantity bounds before a supported Default-style request could proceed. It keeps money as decimal values rather than converting through binary floating point. These are client decisions implemented for the exercise, not claims about every valid API response.

Preserve unknown information for diagnosis. An unfamiliar status should remain attached to its raw value with a review state. Do not label it Completed because it is not in the failure list. Likewise, a missing batch result is unresolved; it is not a zero balance, zero remaining quantity or completed order.

Review the twelve acceptance cases

Case Input condition Expected client behaviour
01 Valid synthetic catalogue Retain all service IDs and usable values
02 Required catalogue field removed Reject that input before it can update offers
03 Observed type unsupported by the local order form Hold purchase preparation for that selection
04 Repeated service ID Reject the ambiguous snapshot
05 Decimal amounts with several fractional places Preserve exact decimal arithmetic and source strings
06 Quantity outside the selected bounds Reject the local purchase input
07 Batch contains a usable item and an item error Keep each item's result independent
08 Requested ID absent from the batch response Mark that ID unresolved
09 Unfamiliar remote status Retain the raw status and require review
10 Malformed creation response Keep creation outcome unknown; do not invent an ID
11 Simulated creation timeout Make one attempt and hold; no blind retry
12 Restart fixture contains an unfinished Sending record Recover to unknown outcome rather than a new draft

The manifest adds an evidence artifact, owner and result for each row. The checked-in result refers to this downloadable exercise. When adapting the manifest to your own application, reset results and record the actual run against the exact code revision being considered for release.

Treat a batch as a collection of separate results

A successful HTTP response does not mean every requested item succeeded. The API's documented batch examples include per-item errors. Your adapter must preserve the relationship between each requested identifier and its own result.

The DEMO status fixture uses one synthetic order with a partial result and another with an error. The local parser produces two separate entries. It does not discard the successful item because its neighbour failed, and it does not turn the error into a normal status record.

A third requested ID is intentionally absent in case 08. The runner marks it unresolved and retains the ID for investigation. That differs from case 07, where the service returned an explicit item error. Keeping those distinctions helps the next operator decide whether to inspect the response, retry an appropriate read or ask technical support about a known order.

For the actions you implement, separately enforce the current documented batch-size constraints and test boundary sizes in your own adapter. This compact suite focuses on interpretation; it does not certify every action, optional field, service type or batch-building path.

Exercise uncertainty without spending money

A simulated timeout should interrupt a fake transport, not a paid API call. The runner counts how many times its local function was invoked, raises a synthetic timeout and verifies that the application returns an unknown outcome after one attempt. That makes a blind-retry defect observable without creating an order.

The restart fixture begins with the local state Sending and no saved external ID. Recovery returns Unknown outcome. This is a state-policy check only; it does not test the durability or concurrency of your production database. Use the separate local-intent design and your own infrastructure tests to verify those properties.

The developer guide explains why creation with no usable response needs reconciliation. The fixture suite makes that boundary explicit in acceptance criteria. It does not assume server idempotency, a lookup by local reference, a webhook or a separate sandbox.

Run the suite and preserve its limits

Save the Python file and both JSON fixtures in the same folder, then run:

python3 ac295-fixture-suite.py

The output lists twelve case results, the overall result and zero network requests. Each case runs against an explicit expectation. A failed assertion makes the run fail; the program does not quietly relabel a failed case as a warning.

Keep the command, runtime version, code revision and result with your release evidence. If you change the parser or supported contract, rerun the affected cases and any dependencies that could change. Do not keep an earlier PASS next to a materially different implementation.

Separate this local evidence from later connection evidence. An authorised read-only call can establish that the configured endpoint, authentication and supported read path work at that time. It still does not establish that a paid order was created correctly or that delivery met a customer's requirements. No read-only request was made for the downloadable exercise.

Make the release decision specific

A defensible acceptance statement says which actions and types are enabled, which local tests passed, which connection checks were performed and which behaviours remain unsupported. Attach unresolved issues to owners and decide whether they block the proposed scope.

For a small initial integration, a sensible decision may be to release catalogue browsing while keeping purchase creation disabled until its ownership and recovery path are verified. Another application may already have those controls and need only a new regression case. The evidence should determine the decision.

Use the current API reference and developer guide when adapting the fixtures. Keep any live order test as a separately authorised operation with explicit scope and cost, and ask technical support about unclear service conditions before enabling them for customers. A twelve-case green report is useful evidence of twelve checked cases; the release record must still describe the system around them.

By AlwaysCompleted · Published