当前位置:网站首页>How to do the interface test in JSON format?
How to do the interface test in JSON format?
2022-07-22 10:38:00 【grownto9】
Back end development process , After development, necessary interface tests should be carried out , Many people will wonder Json What should I do for interface testing of format , In order to let everyone have a rough understanding , Here we use Eolink Interface tool to show you API Import 、 Yes API Test and more advanced Mock test .
( One )、 JSON Format API Import
Import Swagger Platform Json Format file example :
1、 Get into Eolink , Select import Swagger Derived Json file , According to the API Directly create a new project , Click ok .
2、 A task list appears on the right , Click refresh to check whether the import is completed .
3、 After completion, you can refresh manually , You can see that the project has been imported .
( Two )、 How to API To test
1、 Entry project , Select a API Interface
2、 You can edit API Make the relevant configuration
3、 Choose a test
4、 Test interface introduction
5、 Save the current test configuration as a test case for future testing
( 3、 ... and )、 senior Mock Introduce
senior Mock It can be for API Configure relevant parameters and the return results corresponding to this parameter , When the parameters meet Mock When the configuration , Return its corresponding result , The specific operation is as follows :
1、 add to Mock API
Set relevant parameters
2、 Fill in the trigger condition
The trigger condition supports the request header 、 Request body ( From-data、Json ) 、 Query etc.
The figure below shows Form-data Parameter contains additionalMetadata= demo 1 The situation of , Returns static string data :
The following example shows when Form-data Parameter contains additionalMetadata= demo 2 when , Returns static string data :
3、 call Mock API
Get into Mock API List page , Click the call address to copy it to the clipboard , In the code directly to the API You can get the response result by sending the request .
Click to preview , Select preview in the test interface , You can keep the current parameters and jump to the test page .
The test results are as follows :
test additionalMetadata= demo 1 result
test additionalMetadata= demo 2 result
The above illustration tool is Eolink , If you also need to do interface testing , And is looking for an interface testing tool that is easy to operate , I recommend you to use this artifact , Eolink , Not only can API Document management , API automated testing , API Gateway and other functions , It also offers more advanced Mock API Service for , The functions we need to use include . If you are interested, you can try it on the official website :www.eolink.com
边栏推荐
- [explanation of PTA program design topic] [English version] [6-5 use function to verify Goldbach conjecture]
- Collection (properties)
- 1307_ Summary of crystal oscillator test in embedded design
- BigInteger :new BigInteger(tokenJson.getBytes()).toString(16)什么意思
- 【信息收集】从FoFa—API接口数据写入TXT和Excel
- Execution failed for task ‘:app:kaptDevDebugKotlin‘.
- Request to obtain request line data and request header data
- QT creator 8 release
- 控制台字体怎么改为console?
- Some personal understanding
猜你喜欢
Leetcode skimming: dynamic planning 02 (climbing stairs)
Save web pages as PDF artifacts (customizable) - print edit we
11-GuliMall 后台管理中商品系统的分类维护
C # implement setting expiration time for PDF documents
Carbon 语言【中文入门教程】
Baidu PaddlePaddle easydl x wesken: see how to install the "eye of AI" in bearing quality inspection
走出心理舒适区的七个最佳方法
Energy principle and variational method note 10: virtual displacement principle
Embedded bus and communication
Some personal understanding
随机推荐
mysql中的四大运算符种类汇总20多项,用了三天三夜来整理的,还不赶快收藏
动态新增、修改Logback的Appender(可实现动态调整日志级别,Appender参数)
urlParrern配置
封装
代码的一些优化
Enter the password to browse the PHP source code of the web page
Dof景深基础
cron表达式详解
D extend CTFE at compile time
2022 第三方宝塔面板 btcloud PHP源码
史上最全的mysql数据类型汇总-(上)
@resource和@autowired的区别
公司新来一个同事,把 Typora 玩得炉火纯青!太强悍了
Servlet Chapter 1
Execution failed for task ‘:app:kaptDevDebugKotlin‘.
Save web pages as PDF artifacts (customizable) - print edit we
day02-2
d编译时扩展ctfe
d是矩形.
Request获取请求行数据和请求头数据