FakeGatewayTransport class
In-memory GatewayTransport for unit / integration tests.
The fake captures every outbound request and replays programmable responses. It also enforces, at the test layer, the same safe-fields contract the production transport does - if a test accidentally sends a banned key, the fake throws so the test breaks loudly.
Lives under lib/src/gateway/testing/ rather than under
test/ so the POS application can use it for its own
integration tests without copy-paste. It is not exported
from the legacy package:easymerchant_reader_sdk/magteksdk.dart entry
point - only from package:easymerchant_reader_sdk/mobile_reader_sdk.dart.
- Implemented types
Constructors
-
FakeGatewayTransport({Future<
GatewayTransportResponse> responder(GatewayTransportRequest req)?})
Properties
- artificialDelay ↔ Duration?
-
When set, send delays this long before resolving.
getter/setter pair
- hashCode → int
-
The hash code for this object.
no setterinherited
- nextError ↔ GatewayTransportError?
-
When set, send throws this error on the next call
instead of consulting responder.
getter/setter pair
-
requests
→ List<
GatewayTransportRequest> -
final
-
responder
↔ Future<
GatewayTransportResponse> Function(GatewayTransportRequest req)? -
Optional callback that produces a response per request.
Defaults to a 200 OK with a canned approved body.
getter/setter pair
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
send(
GatewayTransportRequest request) → Future< GatewayTransportResponse> -
Send
requestand resolve to a GatewayTransportResponse when the network call completes. Implementations should throw a TimeoutException or GatewayTransportError only for transport-level failures (DNS, TCP reset, TLS handshake, request timeout). HTTP errors (4xx / 5xx) are returned as a normal response with the appropriatestatusCode.override -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited