Integration testing

The purpose of integration testing—also known as functional testing—is to verify the system as a whole. This is also known as black-box testing. Throughout this process, we provide an input, expect the output, verify it, and don't worry about the internals of the code. We just give an input and compare the actual output against the expected one. This kind of testing is more suitable for verifying the RESTful APIs. Once the services are deployed, we make a call to the REST endpoints with an input and verify it for the HTTP status code, response body, response header (if any), and so on.

We will write a simple integration test for the GET organization API. Since this is an integration test case, the  GET organization API is behind the AuthFilter that checks for a valid JWT. So, in our test case, first we have to get a JWT token using the /authorize/jwt/token API, and then invoke the /identity/organization/{orgId} API by passing the token in the request header.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset