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


Java RequestSpecBuilder.setBaseUri方法代码示例

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


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

示例1: configureRequestSpecBuilder

import io.restassured.builder.RequestSpecBuilder; //导入方法依赖的package包/类
void configureRequestSpecBuilder(@Observes RestAssuredConfiguration restAssuredConfiguration,
    CubeDockerConfiguration cubeDockerConfiguration, RequestSpecBuilder requestSpecBuilder) {
    if (restAssuredConfiguration.isBaseUriSet()) {
        requestSpecBuilder.setBaseUri(restAssuredConfiguration.getBaseUri());
    } else {
        requestSpecBuilder.setBaseUri(
            restAssuredConfiguration.getSchema() + "://" + cubeDockerConfiguration.getDockerServerIp());
    }

    if (restAssuredConfiguration.isPortSet()) {
        requestSpecBuilder.setPort(SinglePortBindResolver.resolveBindPort(cubeDockerConfiguration,
            restAssuredConfiguration.getPort(),
            restAssuredConfiguration.getExclusionContainers()));
    } else {
        requestSpecBuilder.setPort(SinglePortBindResolver.resolveBindPort(cubeDockerConfiguration,
            restAssuredConfiguration.getExclusionContainers()));
    }

    if (restAssuredConfiguration.isBasePathSet()) {
        requestSpecBuilder.setBasePath(restAssuredConfiguration.getBasePath());
    }

    if (restAssuredConfiguration.isAuthenticationSchemeSet()) {
        requestSpecBuilder.setAuth(restAssuredConfiguration.getAuthenticationScheme());
    }

    if (restAssuredConfiguration.isUseRelaxedHttpsValidationSet()) {
        if (restAssuredConfiguration.isUseRelaxedHttpsValidationInAllProtocols()) {
            requestSpecBuilder.setRelaxedHTTPSValidation();
        } else {
            requestSpecBuilder.setRelaxedHTTPSValidation(restAssuredConfiguration.getUseRelaxedHttpsValidation());
        }
    }
}
 
开发者ID:arquillian,项目名称:arquillian-cube,代码行数:35,代码来源:RestAssuredCustomizer.java

示例2: lookup

import io.restassured.builder.RequestSpecBuilder; //导入方法依赖的package包/类
@Override
public Object lookup(ArquillianResource resource, Annotation... qualifiers) {

    RequestSpecBuilder requestSpecBuilder = requestSpecBuilderInstance.get();

    if (requestSpecBuilder == null) {
        throw new IllegalStateException("RequestSpecBuilder was not found.");
    }

    //Override with elements provided in DockerUrl
    final Optional<DockerUrl> dockerUrlAnnotation = getDockerUrlAnnotation(qualifiers);

    if (dockerUrlAnnotation.isPresent()) {
        final DockerUrl dockerUrl = dockerUrlAnnotation.get();

        //We only override in case of setting here as https, in other cases, the original value is used which correctly
        // points to docker host.
        if ("https".equals(dockerUrl.protocol())) {
            requestSpecBuilder.setBaseUri(dockerUrl.protocol() + "://" + getHost());
        }

        final String containerName = dockerUrl.containerName();

        final int exposedPort = dockerUrl.exposedPort();
        final int bindPort = getBindingPort(containerName, exposedPort);

        if (bindPort > 0) {
            return requestSpecBuilder.setPort(bindPort);
        } else {
            logger.log(Level.WARNING, String.format("There is no container with id %s.", containerName));
        }

        requestSpecBuilder.setBasePath(dockerUrl.context());
    }

    return requestSpecBuilder;
}
 
开发者ID:arquillian,项目名称:arquillian-cube,代码行数:38,代码来源:RequestSpecBuilderResourceProvider.java

示例3: configureRequestSpecBuilder

import io.restassured.builder.RequestSpecBuilder; //导入方法依赖的package包/类
void configureRequestSpecBuilder(@Observes RestAssuredConfiguration restAssuredConfiguration, CubeOpenShiftConfiguration openShiftConfiguration, RequestSpecBuilder requestSpecBuilder) {
    if (restAssuredConfiguration.isBaseUriSet()) {
        requestSpecBuilder.setBaseUri(restAssuredConfiguration.getBaseUri());
    } else {
        requestSpecBuilder.setBaseUri(
            restAssuredConfiguration.getSchema() + "://" + openShiftConfiguration.getMasterUrl());
    }

    if (restAssuredConfiguration.isPortSet()) {
        requestSpecBuilder.setPort(restAssuredConfiguration.getPort());
    } else {
        requestSpecBuilder.setPort(openShiftConfiguration.getOpenshiftRouterHttpPort());
    }

    if (restAssuredConfiguration.isBasePathSet()) {
        requestSpecBuilder.setBasePath(restAssuredConfiguration.getBasePath());
    }

    if (restAssuredConfiguration.isAuthenticationSchemeSet()) {
        requestSpecBuilder.setAuth(restAssuredConfiguration.getAuthenticationScheme());
    }

    if (restAssuredConfiguration.isUseRelaxedHttpsValidationSet()) {
        if (restAssuredConfiguration.isUseRelaxedHttpsValidationInAllProtocols()) {
            requestSpecBuilder.setRelaxedHTTPSValidation();
        } else {
            requestSpecBuilder.setRelaxedHTTPSValidation(restAssuredConfiguration.getUseRelaxedHttpsValidation());
        }
    }
}
 
开发者ID:arquillian,项目名称:arquillian-cube,代码行数:31,代码来源:RestAssuredCustomizer.java

示例4: configureRequestSpecBuilder

import io.restassured.builder.RequestSpecBuilder; //导入方法依赖的package包/类
private RequestSpecBuilder configureRequestSpecBuilder(URL route) {
    final RequestSpecBuilder requestSpecBuilder = requestSpecBuilderInstance.get();
    if (requestSpecBuilder == null) {
        throw new IllegalStateException("RequestSpecBuilder was not found.");
    }

    requestSpecBuilder.setBaseUri(route.getProtocol() + "://" + route.getHost());
    requestSpecBuilder.setPort(route.getPort());
    requestSpecBuilder.setBasePath(route.getPath());

    awaitRoute(route);
    return requestSpecBuilder;
}
 
开发者ID:arquillian,项目名称:arquillian-cube,代码行数:14,代码来源:RequestSpecBuilderResourceProvider.java


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