當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。