API Shield

Ensure that your APIs are functioning correctly

With API Shield, part of TestShield, you can test REST-based APIs, including Power Automate flows and Azure APIs, using the same codeless designer as every other TestShield test.

North52 API Shield

Assemble. Arrange. Act. Assert.®

Setting up a API Shield test follows the same four A’s pattern as every TestShield test.

  1. 1

    Assemble

    Describes the API functionality being tested.

  2. 2

    Arrange

    Define the test data inputs.

  3. 3

    Act

    Define how the API is called and which parameters are passed.

  4. 4

    Assert

    Define the expected results, based on the parameters the test passed.

API Shield tests run manually, as part of an automated Test Runner schedule, or from Azure DevOps.

A worked example

A third-party API that has to keep behaving

The test calls a public exchange-rates API and counts what comes back. If the provider changes the shape of its response, or quietly starts returning fewer rates than it used to, the test says so before your process does. The same shape covers any REST endpoint, inside your tenant or outside it.

Assemble

The API behaviour described in Gherkin, endpoint included.

The Assemble sheet of an API Shield test named Open Exchange Rates API: a Gherkin scenario reading, as an administrator I want to ensure the Open Exchange Rates API returns the expected number of rates, so that when our systems interact with it I am confident it has not changed. Given a valid APP ID, when a GET request is made to the API, then a JSON response with the latest exchange rates is returned.

The API behaviour described in Gherkin, endpoint included.

Arrange

No inputs are needed for this call, so the sheet stays empty.

The Arrange sheet of the same test, holding two named but empty data columns, Input One and Input Two. This call needs no input values, so no rows are filled in.

No inputs are needed for this call, so the sheet stays empty.

Act

The GET request itself, built with CallRestAPI.

The Act sheet of the same test: a single Perform Action row named Get Exchange Rates, calling CallRestAPI with the base URL set to the exchange rates API and the resource set to latest.json.

The GET request itself, built with CallRestAPI.

Assert

The number of rates returned, checked against the expected count.

The Assert sheet of the same test: an AssertAreEqual row whose actual value counts the records returned by the Get Exchange Rates call and whose expected value is 171, with the step message Count Rates.

The number of rates returned, checked against the expected count.

See API Shield on your own processes.