The Fundamentals of HTTP API Unit Testing
A closer look at unit testing within the context of HTTP APIs
Jul 2, 2018
Increase the test coverage of your web APIs so they break less for your consumers online. Create a full collection of tests with Stoplight Testing. Use Environment and Context Variables to reference other complex test scenarios to accelerate test generations and reduce duplication. Whether you are writing test for just one API call or a scenario of API calls working together in a real-life use case, Stoplight Testing gives you the flexibility to make your tests fit you workflow by supporting command line and CI/CD pipeline integrations. Contract Testing your API against your OpenAPI Specification (formerly known as Swagger) or JSON Schema is possible with our simple visual Test Editor.
With our Visual Test Editor, create multi-step test scenarios to automate testing your REST web APIs. Build scenarios by capturing and passing data between test API calls. Then integrate your test scenarios into your existing CI/CD pipeline with our command line tool, powered by Prism.
Create test collections that ensure the API implementation meets the standards and definitions described in your OpenAPI Specification or JSON Schema, also known as Contract Testing. Stoplight uses realistic, dynamic data based on your OpenAPI Specification to simulate real-life API consumers across your local development, staging, and production environments complementing your Unit tests.
With integrated Contract Testing reporting capabilities, you can track your progress towards 100% coverage. Stoplight verifies that the API responses for different status codes match the contract of a connected OpenAPI Specification; enabling collaboration over API test coverage within your organization.