Testing Demo Applications
Last updated
Last updated
There are 4 microservices deployed in the cluster by the script. Three of them expose a few REST APIs and another one exposes SOAP APIs.
Those services that expose REST APIs come with Swagger UI to which you can use testing the APIs in each service. However, you can also use Postman to test both of REST APIs and SOAP APIs as well.
There are 4 Postman collections you can use for API testing:
Open a route for the service that you need to test.
Append /swagger-ui
at the end of URL then press Enter
. You should be able to see Swagger UI page that shows all REST API endpoints exposed by the service.
Click on the endpoint you need to test, the panel will expand. Then click on Try it out button.
Enter paramenter(s) (if necessary), then click Execute button. The request URL and response will be shown up like a screenshot below.
Create a new workspace.
Edit Postman cluster-domain
environment variable by replacing the OpenShift cluster domain you've provisioned in the CURRENT VALUE colume. Then click Save button.
Select Collections panel.
Open the request you need to test.
Make sure you've select the Default environment (should be done only once).
Click Send button to send request to server.
Select Collections panel then open the request you need to test. Go to Authorization tab, scroll to bottom then click Get New Access Token button.
Postman will send request to Authentication Server (SSO, in this case) to get a token based on Client ID, Client Secret, and Realm configured in Postman Environments (variables). An access token should be returned from the server, then click Proceed button.
The Manage Access Tokens dialog will pop up with access token details. Click on Use Token button Postman will populate necessary HTTP headers.
Now you can submit a API request to server.
You can reuse the access token with other API requests as well. In the Authorization tab for the request you need to reuse the token, just select the available token. And note that you can also manage existing tokens as well.
- Used for testing the APIs exposed by microservices through the OpenShift Route directly.
- Used for testing the APIs exposed through API Gateway using API Key as a credential for authentication.
- Used for testing the APIs exposed through API Gateway using Application ID and Application Key pair as a credential for authentication.
- Used for testing the APIs exposed through API Gateway with OpenID Connect OAuth 2.0 authentication.
There is also a contains all environment vairables used by the collections. The enviroment variables are used to store values e.g. cluster domain, credentials etc.
Import these into the workspace.
Import this into the workspace.