本文整理汇总了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());
}
}
}
示例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;
}
示例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());
}
}
}
示例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;
}