Table of contents

Set up end-to-end tests

The integration environment is not accredited to use real user data, and it has no links to real identity providers.

If you are linking identities received from Verify to information in your database, you should make sure to test against potential problematic scenarios.

A test identity provider contains:

  • the user administration API – you should have submitted your credentials when you requested access to the environment.

  • a connection to the hub in the integration environment, which is used for end-to-end testing – no authentication credentials are required

Setup for end-to-end testing involves the following procedures:

Create test users

This procedure describes how to create test users in bulk and load them into the test identity provider. You must add the same test users to your local datastore in the integration environment.

Make an HTTP POST to the user administration API with a JSON document containing an array of user data. For example:

curl --user '{username}:{password}' -H 'Content-Type: application/json' -d @create-user.json https://idp-stub-integration.ida.digital.cabinet-office.gov.uk/{idp-name}/users

where:

  • username and password are your credentials for managing test users
  • idp-name is the name of the test identity provider. Completing a journey in the integration environment will help you find this. On the identity provider page, you’ll see your designated idp-name in the url.
  • create-user.json is the name of the file containing an array of test user data in JSON format, for example:
[{
    "pid": "00754148-902f-4d94-b0db-cb1f7eb3fd84",
    "username": "user1",
    "password": "password",
    "firstName": {
        "value": "Fred",
        "verified": true
    },
    "gender": {
        "value": "MALE",
        "verified": false
    },
    "dateOfBirth": {
        "value": "1970-01-01",
        "verified": true
    },
    "address": {
        "verified": true,
        "postCode": "WC2B 6NH",
        "lines": [
            "Aviation House",
            "London"
        ]
    },
    "levelOfAssurance": "LEVEL_2",
    "surnames": [{
        "value": "Smith",
        "verified": true
    }]
}]

Possible values are shown in the following table.

Attribute Value
levelOfAssurance Level of assurance must be one of the following values: * LEVEL_X * LEVEL_1 * LEVEL_2 * LEVEL_3 * LEVEL_4
firstName surnames dateOfBirth These attributes can contain the following fields: * value (variable type) * DateTime from (the time when this value started - eg changed name to this - Optional) * DateTime to (The time after which this value ended - eg changed name from this - Optional) * boolean verified
gender Gender must be one of the following values: * FEMALE * MALE * NOT_SPECIFIED
address Address consists of: * boolean verified * DateTime fromDate * DateTime toDate (Optional) * String postCode (Optional) * List lines * String internationalPostCode (Optional) * String uprn (Optional)

View test users

To view existing test users, GET the users resource from the relevant test identity provider. For example:

curl --user '{username}:{password}' https://idp-stub-integration.ida.digital.cabinet-office.gov.uk/{idp-name}/users

where idp-name is the name of the test identity provider.

The test users are returned in JSON format. To view the page you must provide your credentials for managing test users. You create the credentials by submitting the environment access form.

Delete test users

To delete test users from the test identity provider, POST a JSON document to the user administration API containing the usernames you want to delete. For example:

curl --user '{username}:{password}' --data '{"username": "user1"}' -H 'Content-Type: application/json'  https://idp-stub-integration.ida.digital.cabinet-office.gov.uk/{idp-name}/users/delete

where:

  • user1 is the name of the test user you want to delete
  • username and password are your credentials for managing test users
  • idp-name is the name of the test identity provider