当前位置: 首页>>代码示例>>Java>>正文


Java RestAssured.authentication方法代码示例

本文整理汇总了Java中com.jayway.restassured.RestAssured.authentication方法的典型用法代码示例。如果您正苦于以下问题:Java RestAssured.authentication方法的具体用法?Java RestAssured.authentication怎么用?Java RestAssured.authentication使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.jayway.restassured.RestAssured的用法示例。


在下文中一共展示了RestAssured.authentication方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: setup

import com.jayway.restassured.RestAssured; //导入方法依赖的package包/类
@BeforeClass
static public void setup() throws MalformedURLException {
    // set base URI and port number to use for all requests
    String serverUrl = System.getProperty("test.url");
    String protocol = DEFAULT_PROTOCOL;
    String host = DEFAULT_HOST;
    int port = DEFAULT_PORT;

    if (serverUrl != null) {
        URL url = new URL(serverUrl);
        protocol = url.getProtocol();
        host = url.getHost();
        port = (url.getPort() == -1) ? DEFAULT_PORT : url.getPort();
    }

    RestAssured.baseURI = protocol + "://" + host;
    RestAssured.port = port;

    // set user name and password to use for basic authentication for all requests
    String userName = System.getProperty("test.user");
    String password = System.getProperty("test.pwd");

    if (userName != null && password != null) {
        RestAssured.authentication = RestAssured.basic(userName, password);
        RestAssured.useRelaxedHTTPSValidation();
    }

}
 
开发者ID:eclipse,项目名称:microprofile-metrics,代码行数:29,代码来源:MpMetricTest.java

示例2: init

import com.jayway.restassured.RestAssured; //导入方法依赖的package包/类
@BeforeClass
public void init() {
  RestAssured.authentication = RestAssured.basic("LSGjeU4yP1X493ud1hNniA==", "");
}
 
开发者ID:barancev,项目名称:java_pft,代码行数:5,代码来源:RestAssuredTests.java

示例3: RestHelper

import com.jayway.restassured.RestAssured; //导入方法依赖的package包/类
public RestHelper(ApplicationManager app) {
    this.app = app;
    RestAssured.authentication = RestAssured.basic(app.getProperty("rest.token"), "");
}
 
开发者ID:webarchitect609,项目名称:jstudy,代码行数:5,代码来源:RestHelper.java


注:本文中的com.jayway.restassured.RestAssured.authentication方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。