{"templateId":"markdown","sharedDataIds":{"sidebar":"sidebar-sidebars/sdk_sidebars.yaml"},"props":{"metadata":{"markdoc":{"tagList":[]},"type":"markdown"},"seo":{"title":"Testing overview","description":"The specifications of Ratepay's APIs for easy payment transactions.","siteUrl":"https://docs.ratepay.com","keywords":"Ratepay developer portal, Ratepay api portal, Ratepay api reference docs","llmstxt":{"hide":false,"sections":[{"title":"Table of contents","includeFiles":["**/*"],"excludeFiles":[]}],"excludeFiles":[]}},"dynamicMarkdocComponents":[],"compilationErrors":[],"ast":{"$$mdtype":"Tag","name":"article","attributes":{},"children":[{"$$mdtype":"Tag","name":"Heading","attributes":{"level":1,"id":"testing-overview","__idx":0},"children":["Testing overview"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"how-to-test-your-code-that-uses-the-sdk","__idx":1},"children":["How to test your code that uses the SDK"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The published SDK artifact doesn't include a fake, in-memory, or stub implementation of ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["RatepayClient"]}," ","for you to import into your tests. What it does provide is a ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["plain interface"]}," designed for exactly this"," ","purpose: you can mock it, fake it, or wrap it."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["In practice, that means the standard approach, mocking ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["RatepayClient"]}," with whatever mocking library your"," ","project already uses, works cleanly: it's a normal public interface with no final classes or sealed"," ","restrictions blocking it. See ",{"$$mdtype":"Tag","name":"a","attributes":{"href":"/docs/developer/sdk/testing/unit-testing-the-quickstart-flow"},"children":["Unit testing the quickstart flow"]}," ","for a worked example."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"sandbox-vs-mocked-tests","__idx":2},"children":["Sandbox vs. mocked tests"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Mocking ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["RatepayClient"]}," is for testing ",{"$$mdtype":"Tag","name":"em","attributes":{},"children":["your own code's logic"]}," against the SDK's contract, branching on"," ","outcomes, mapping exceptions, retry logic etc, without making network calls. It doesn't validate that your"," ","actual request payloads are accepted by the real API. For that, run the same flow against"," ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Environment.INTEGRATION"]}," - see ",{"$$mdtype":"Tag","name":"a","attributes":{"href":"/docs/developer/sdk/testing/sandbox-testing"},"children":["Sandbox testing"]},"."]}]},"headings":[{"value":"Testing overview","id":"testing-overview","depth":1},{"value":"How to test your code that uses the SDK","id":"how-to-test-your-code-that-uses-the-sdk","depth":2},{"value":"Sandbox vs. mocked tests","id":"sandbox-vs-mocked-tests","depth":2}],"frontmatter":{"seo":{"title":"Testing overview"}},"lastModified":"2026-08-17T10:04:52.000Z","pagePropGetterError":{"message":"","name":""}},"slug":"/docs/developer/sdk/testing/testing-overview","userData":{"isAuthenticated":false,"teams":["anonymous"]},"isPublic":true}