51Testing软件测试论坛

 找回密码
 (注-册)加入51Testing

QQ登录

只需一步,快速开始

微信登录,快人一步

手机号码,快捷登录

查看: 10679|回复: 0
打印 上一主题 下一主题

【推荐原文】How to Extract Values When Spring Boot API Testing With REST Assured

[复制链接]
  • TA的每日心情
    慵懒
    2019-2-2 13:49
  • 签到天数: 242 天

    连续签到: 1 天

    [LV.8]测试军长

    跳转到指定楼层
    1#
    发表于 2017-8-16 14:52:57 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
    原文作者:Grigor Avagyan
    作者联系方式:无
    原文地址链接:https://www.blazemeter.com
    推荐理由:可以学会如何提取API测试的值


    The ability to extract values and use them in the following subsequent request is an important ability in modern API Testing solutions. In this blog post I will show you how to extract and assert these values, by using Java, Gradle, Intellij and REST Assured.

    Intellij is an integrated development environment, REST Assured is an open-source framework for testing REST services in Java, and Gradle is a Build tool. You can choose different tools for this kind of testing. It all depends on your preferences and taste, and of course which kind of project you are testing.

    For demo testing, I created a small API with Java / Spring Boot and Hibernate. The API has 4 Controllers - Arrival, Departure, Users and Flight. Each of them has 2 or more endpoints/paths for calling by different types of request. Most of them are GET, but there are also POST and DELETE requests in some paths. You can run this test yourself, from here.

    The testing shown here will cover all simple areas for endpoints testing, e.g. schema validation of JSON response, request time, allowed methods and etc. Unit testing is not included.

    Step 1 - Create a API Testing Project

    1. Install IntelliJ IDEA

    2. Make sure you have JDK installed (at least version 1.8.XXX).

    Now we will create a new project.

    3. Open IntelliJ and click “Create New Project”
    ......

    (下载附件即可查看原文)

    【申请翻译方式】
    ① 发送一段试译内容到我们的邮箱 editor@51testing.com,通过后即可翻译
    ② 加小编 QQ:1718403480,备注:翻译试译


    【翻译奖励】
    ① 翻译文章经过评审入选后,即可发布在《51测试天地》电子刊物中,并有相应稿费支付!还有机会上网站头条,得到大力宣传!
    ② 未入选文章,也可以获得博为峰网校10元代金券


    如果你想锻炼自己的翻译能力,或者想学习最新最热的技术内容,欢迎加入到我们的翻译队伍中来!!

    本帖子中包含更多资源

    您需要 登录 才可以下载或查看,没有帐号?(注-册)加入51Testing

    x
    分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
    收藏收藏
    回复

    使用道具 举报

    本版积分规则

    关闭

    站长推荐上一条 /1 下一条

    小黑屋|手机版|Archiver|51Testing软件测试网 ( 沪ICP备05003035号 关于我们

    GMT+8, 2024-11-23 17:45 , Processed in 0.064263 second(s), 24 queries .

    Powered by Discuz! X3.2

    © 2001-2024 Comsenz Inc.

    快速回复 返回顶部 返回列表