Wiki source code of Testing API Gateway

Last modified by Martijn Woudstra on 2022/08/30 12:22

Hide last authors
Martijn Woudstra 18.1 1 {{container}}{{container layoutStyle="columns"}}(((
2 In this microlearning, we will focus on testing your API Gateway (operations) with the help of two functionalities that the platform offers. First, we take a look at flow testing, secondly, we turn our attention to Swagger UI.
3
4 Should you have any questions, please contact [[academy@emagiz.com>>mailto:academy@emagiz.com]].
5
6 == 1. Prerequisites ==
7
8 * Basic knowledge of the eMagiz platform
9 * Basic knowledge of the API Gateway pattern
10
11 == 2. Key concepts ==
12
13 This microlearning centers around testing the API Gateway (operations).
14 With testing, we mean: Verifying that the operation does what it is supposed to do
15
16 * Flow testing is meant for testing the exit gates
17 * Swagger UI is meant for testing the whole operation as a client
18 * Both play an intricate part in testing your API Gateway
19
20 == 3. Testing API Gateway ==
21
22 In this microlearning, we will focus on testing your API Gateway (operations) with the help of two functionalities that the platform offers. First, we take a look at flow testing, secondly, we turn our attention to Swagger UI.
23
24 * Flow testing is meant for testing the exit gates
25 * Swagger UI is meant for testing the whole operation as a client
26 * Both play an intricate part in testing your API Gateway
27
28 === 3.1 Flow Testing ===
29
30 In the [[Crash Course Platform>>doc:Main.eMagiz Academy.Microlearnings.Crash Course.Crash Course Platform.WebHome||target="blank"]] we have several microlearnings on the topic of flow testing. Please take a look at those microlearnings first if the concept of flow testing is new to you. As described there the flow testing functionality also works for API Gateway exit gates. With the help of the flow testing functionality, you can test the functional part of the API Gateway exit flow (i.e. transformation, authentication logic, filtering, and error handling) without testing the connectivity to the external system. This way you can increase the chances of being first time right before deploying your solution on the Test (or Acceptance) environment. A typical flow test for an exit gate looks as follows.
31
32 [[image:Main.Images.Microlearning.WebHome@intermediate-testing-emagiz-api-gateway-testing-the-api-gateway--flow-test-configuration.png]]
33
34 === 3.2 Testing with Swagger UI ===
35
36 When you navigate to the Swagger UI page you will see that there is a try-it-out button per operation. After you have pressed this button you will see a button called Execute appear.
37 By pressing this button you will test the API Gateway functionality of a specific operation as if you were the client.
38
39 [[image:Main.Images.Microlearning.WebHome@intermediate-testing-emagiz-api-gateway-testing-the-api-gateway--swagger-ui-execute-try-it-out.png]]
40
41 The Swagger UI will give feedback based on what happened after you have pressed the button to execute
42
43 [[image:Main.Images.Microlearning.WebHome@intermediate-testing-emagiz-api-gateway-testing-the-api-gateway--feedback-inswagger-ui.png]]
44
45 == 4. Assignment ==
46
47 Execute a flow test on the exit gate belonging to one operation. When satisfied please run your API Gateway locally and access the Swagger UI via the browser. Authenticate yourself and test at least one operation.
48 This assignment can be completed with the help of the (Academy) project that you have created/used in the previous assignment.
49
50 == 5. Key takeaways ==
51
52 * Flow testing is meant for testing the exit gates
53 * Swagger UI is meant for testing the whole operation as a client
54 * Both play an intricate part in testing your API Gateway
55
56 == 6. Suggested Additional Readings ==
57
58 If you are interested in this topic and want more information on it please read the help text provided by eMagiz.
59
60 == 7. Silent demonstration video ==
61
62 There is no demonstration video of this functionality.
63
64 )))((({{toc/}}))){{/container}}{{/container}}