本文整理汇总了Java中com.jayway.restassured.RestAssured.baseURI方法的典型用法代码示例。如果您正苦于以下问题:Java RestAssured.baseURI方法的具体用法?Java RestAssured.baseURI怎么用?Java RestAssured.baseURI使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.jayway.restassured.RestAssured
的用法示例。
在下文中一共展示了RestAssured.baseURI方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: configureRestAssured
import com.jayway.restassured.RestAssured; //导入方法依赖的package包/类
@BeforeClass
public static void configureRestAssured() {
Vertx vertx = Vertx.vertx();
JsonObject config = new JsonObject().put("server.port", getRandomPort());
LoginHandler loginHandler = new LoginHandler();
loginHandler.setInvocationHandler(new VertxInvocationHandler(vertx));
RestVerticle restVerticle = new RestVerticle();
restVerticle.setRequestHandlers(Arrays.asList(loginHandler));
ServiceVerticle serviceVerticle = new ServiceVerticle();
serviceVerticle.setServiceHandlers(Arrays.asList(loginHandler));
DeploymentOptions options = new DeploymentOptions().setConfig(config);
vertx.deployVerticle(restVerticle, options);
vertx.deployVerticle(serviceVerticle, options);
RestAssured.baseURI = "http://localhost";
RestAssured.port = config.getInteger("server.port");
}
示例2: 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();
}
}
示例3: init
import com.jayway.restassured.RestAssured; //导入方法依赖的package包/类
/**
* Method called to initialize basic resources after the object is created.
*/
@PostConstruct
public void init() {
mockExternalAuthorization();
RestAssured.baseURI = BASE_URL;
RestAssured.port = serverPort;
RestAssured.config = RestAssuredConfig.config().objectMapperConfig(
new ObjectMapperConfig().jackson2ObjectMapperFactory((clazz, charset) -> objectMapper)
);
RamlDefinition ramlDefinition = RamlLoaders.fromClasspath()
.load("api-definition-raml.yaml").ignoringXheaders();
restAssured = ramlDefinition.createRestAssured();
}
示例4: setUp
import com.jayway.restassured.RestAssured; //导入方法依赖的package包/类
/**
* Sets the up.
*/
@Before
@Sql({"/schemaIT.sql", "/dataIT.sql"})
public void setUp() {
RestAssured.baseURI="http://localhost";
RestAssured.port=serverPort;
}
示例5: before
import com.jayway.restassured.RestAssured; //导入方法依赖的package包/类
@Before
public void before() {
RestAssured.config().httpClient(HttpClientConfig.httpClientConfig().setParam("CONNECTION_MANAGER_TIMEOUT", 3600*1000));
RestAssured.baseURI = baseUrl.toExternalForm();
mockUtil.mockErpDestination(mockUtil.getErpSystem());
mockUtil.mockDestination("SuccessFactorsODataEndpoint", "sfsf");
}
示例6: beforeClass
import com.jayway.restassured.RestAssured; //导入方法依赖的package包/类
@BeforeClass
public static void beforeClass() {
RestAssured.baseURI = BASE_URL;
RestAssured.port = PORT;
RestAssured.basePath = STREAMS;
if (!EVENT_STORE_PROVIDER.isRunning()) {
EVENT_STORE_PROVIDER.start();
}
}
示例7: setUp
import com.jayway.restassured.RestAssured; //导入方法依赖的package包/类
@BeforeClass
public void setUp() {
RestAssured.baseURI = System.getenv("ACCOUNT_SERVICE_HOST"); //"http://account-service";
RestAssured.port = Integer.parseInt(System.getenv("ACCOUNT_SERVICE_PORT"));
RestAssured.basePath = System.getenv("ACCOUNT_SERVICE_BASE_PATH");
RestAssured.filters(new AllureRequestLoggingFilter(), new AllureResponseLoggingFilter());
}
示例8: before
import com.jayway.restassured.RestAssured; //导入方法依赖的package包/类
@Override
public void before() throws Throwable {
assertPackageBuilt();
unzipDistribution();
engineProcess = newEngineProcess(port, redisPort);
waitForEngine();
RestAssured.baseURI = uri().toURI().toString();
}
示例9: before
import com.jayway.restassured.RestAssured; //导入方法依赖的package包/类
@Override
protected final void before() throws Throwable {
RestAssured.baseURI = uri().toURI().toString();
if (!config.getProperty(GraknConfigKey.TEST_START_EMBEDDED_COMPONENTS)) {
return;
}
SimpleURI redisURI = new SimpleURI(Iterables.getOnlyElement(config.getProperty(GraknConfigKey.REDIS_HOST)));
jedisPool = new JedisPool(redisURI.getHost(), redisURI.getPort());
// To ensure consistency b/w test profiles and configuration files, when not using Janus
// for a unit tests in an IDE, add the following option:
// -Dgrakn.conf=../conf/test/tinker/grakn.properties
//
// When using janus, add -Dgrakn.test-profile=janus
//
// The reason is that the default configuration of Grakn uses the Janus Factory while the default
// test profile is tinker: so when running a unit test within an IDE without any extra parameters,
// we end up wanting to use the JanusFactory but without starting Cassandra first.
LOG.info("starting engine...");
// start engine
setRestAssuredUri(config);
EngineID id = EngineID.me();
spark = Service.ignite();
GraknEngineStatus status = new GraknEngineStatus();
MetricRegistry metricRegistry = new MetricRegistry();
RedisWrapper redis = RedisWrapper.create(config);
GraknCreator creator = GraknCreator.create(id, spark, status, metricRegistry, config, redis);
server = creator.instantiateGraknEngineServer(Runtime.getRuntime());
server.start();
LOG.info("engine started on " + uri());
}
示例10: beforeClass
import com.jayway.restassured.RestAssured; //导入方法依赖的package包/类
/**
* Initialization that is performed once before any of the tests in this
* class are executed.
*
* @throws Exception
*/
@BeforeClass
public static void beforeClass() throws Exception
{
RestAssured.baseURI = BASE_URI;
RestAssured.port = PORT;
f = Fixtures.getInstance();
RestExpressManager.getManager().ensureRestExpressRunning();
}
示例11: setUp
import com.jayway.restassured.RestAssured; //导入方法依赖的package包/类
/**
* Run before each test.
*/
@Before
@Sql({"/schemaIT.sql", "/dataIT.sql"})
public void setUp() {
RestAssured.baseURI="http://localhost";
RestAssured.port=serverPort;
}
示例12: setUp
import com.jayway.restassured.RestAssured; //导入方法依赖的package包/类
/**
* Run before each test.
*/
@Before
@Sql({ "/schemaIT.sql", "/dataIT.sql" })
public void setUp() {
RestAssured.baseURI = "http://localhost";
RestAssured.port = serverPort;
}
示例13: setUp
import com.jayway.restassured.RestAssured; //导入方法依赖的package包/类
/**
* Run before each test.
*/
@Before
@Sql({"/schemaIT.sql", "/dataIT.sql"})
public void setUp() {
RestAssured.baseURI="http://localhost";
RestAssured.port=serverPort;
}
示例14: beforeClass
import com.jayway.restassured.RestAssured; //导入方法依赖的package包/类
/**
* Initialization that is performed once before any of the tests in this
* class are executed.
*
* @throws Exception
*/
@BeforeClass
public static void beforeClass() throws Exception
{
RestAssured.baseURI = BASE_URI;
RestAssured.port = PORT;
RestAssured.basePath = "/databases";
/* String testEnv = System.getProperty("TEST_ENV") != null ? System.getProperty("TEST_ENV") : "local";
String[] env = {testEnv};
Thread.sleep(10000);*/
logger.debug("Loading RestExpress Environment... ");
f = Fixtures.getInstance();
RestExpressManager.getManager().ensureRestExpressRunning();
}
示例15: setup
import com.jayway.restassured.RestAssured; //导入方法依赖的package包/类
@Before
public void setup() {
await().atMost(5, TimeUnit.MINUTES).until(() -> {
try {
return get(url).getStatusCode() == 200;
} catch (Exception e) {
return false;
}
});
RestAssured.baseURI = url + "api/greeting";
}