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


Java RestAssured.baseURI方法代码示例

本文整理汇总了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");
}
 
开发者ID:simonemasoni,项目名称:vertx_spring,代码行数:23,代码来源:IntegrationTest.java

示例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();
    }

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

示例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();
}
 
开发者ID:OpenLMIS,项目名称:openlmis-stockmanagement,代码行数:19,代码来源:BaseWebIntegrationTest.java

示例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;
	
}
 
开发者ID:andju,项目名称:findlunch,代码行数:12,代码来源:LoginUserRestControllerIT.java

示例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");
}
 
开发者ID:SAP,项目名称:cloud-s4-sdk-examples,代码行数:9,代码来源:CostCenterEmployeesServiceTest.java

示例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();
   }
}
 
开发者ID:Qyotta,项目名称:axon-eventstore,代码行数:10,代码来源:AbstractEsTest.java

示例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());
}
 
开发者ID:dins-heisenbug-2016,项目名称:piggymetrics,代码行数:8,代码来源:AccountServiceTest.java

示例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();
}
 
开发者ID:graknlabs,项目名称:grakn,代码行数:9,代码来源:DistributionContext.java

示例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());
}
 
开发者ID:graknlabs,项目名称:grakn,代码行数:38,代码来源:EngineContext.java

示例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();
}
 
开发者ID:PearsonEducation,项目名称:Docussandra,代码行数:15,代码来源:AbstractTableControllerTest.java

示例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;
	
}
 
开发者ID:andju,项目名称:findlunch,代码行数:12,代码来源:OfferPhotoRestControllerIT.java

示例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;

}
 
开发者ID:andju,项目名称:findlunch,代码行数:12,代码来源:RestaurantTypeRestControllerIT.java

示例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;
}
 
开发者ID:andju,项目名称:findlunch,代码行数:11,代码来源:RestaurantRestControllerIT.java

示例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();
    }
 
开发者ID:PearsonEducation,项目名称:Docussandra,代码行数:21,代码来源:AbstractDatabaseControllerTest.java

示例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";
}
 
开发者ID:wildfly-swarm-openshiftio-boosters,项目名称:wfswarm-rest-http,代码行数:13,代码来源:OpenshiftIT.java


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