soapUI 调用JIRA Rest API接口实现新建bug

调用JIRA Rest API接口实现新建bug

1. 在SoapUI中新建 REST Project ;

2. 选中service url,右键New REST Resource录入:/rest/api/2/issue(Adds a new resource using a resource path or URL)

3. 在载入的请求request中,设置application/json类型的请求报文;

4. 设置认证方式为Basic,录入username和password,选中Authenticate pre-emptively(先发制人地认证)

 

请求报文如下:

{
    "fields": {
       "project": {"key": "VVII"},
       "summary": "something's wrong",
       "description": "Creating of an issue using ids for projects and issue types using the REST API",
       "issuetype": {"name": "生产问题"},
       "components": [{"name": "其他"}],
       "customfield_10006": {"name": "liuyitan"},
       "customfield_10007": {"name": "liuyitan"}
       }
   }
}

SoapUI中接口认证方式

soap API 认证类型:Basic,NTLM,SPNEGO/Kerberos

rest API 认证类型:Basic,NTLM,SPNEGO/Kerberos,OAuth 2.0, OAuth 1.0

扫描二维码关注公众号,回复: 2142574 查看本文章

2007年发布了Oauth1.0协议,2.0的草案与2011年发布。

1、OAuth1.0的用户授权过程

  • 客户端到授权服务器请求一个授权令牌(Request Token&Secret)
  • 引导用户到授权服务器请求授权
  • 用访问令牌到授权服务器换取访问令牌(Access Token&Secret)
  • 用访问令牌去访问得到授权的资源

2、OAuth2.0的用户授权过程(过程可参考流程图)

  • 引导用户到授权服务器,请求用户授权,用户授权后返回 授权码(Authorization Code)
  • 客户端由授权码到授权服务器换取访问令牌(Access Token)
  • 用访问令牌去访问得到授权的资源

  (Client指第三方应用,Resource Owner指用户,Authorization Server是我们的授权服务器,Resource Server是API服务器。)

猜你喜欢

转载自www.cnblogs.com/liuyitan/p/9238675.html