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


Java RestAssured.basePath方法代码示例

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


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

示例1: beforeTest

import com.jayway.restassured.RestAssured; //导入方法依赖的package包/类
@Before
public void beforeTest() throws Exception
{
    CacheFactory.clearAllCaches();//kill the cache and make it re-create for the purposes of this test.
    f.clearTestTables();
    Database testDb = Fixtures.createTestDatabase();
    f.insertDatabase(testDb);
    Table testTable = Fixtures.createTestTable();
    f.insertTable(testTable);
    f.insertIndex(Fixtures.createTestIndexOneField());
    f.insertIndex(Fixtures.createTestIndexTwoField());
    f.insertIndex(Fixtures.createTestIndexWithBulkDataHit());
    f.insertDocument(Fixtures.createTestDocument());
    Document onePrime = Fixtures.createTestDocument();
    onePrime.setUuid(new UUID(onePrime.getUuid().getMostSignificantBits() + 2, 1L));
    f.insertDocument(onePrime);
    f.insertDocument(Fixtures.createTestDocument2());
    Document twoPrime = Fixtures.createTestDocument2();
    twoPrime.setUuid(new UUID(twoPrime.getUuid().getMostSignificantBits() + 3, 2L));
    f.insertDocument(twoPrime);
    f.insertDocuments(Fixtures.getBulkDocuments());
    RestAssured.basePath = "/databases/" + testDb.getName() + "/tables/" + testTable.getName() + "/queries";
}
 
开发者ID:PearsonEducation,项目名称:Docussandra,代码行数:24,代码来源:AbstractQueryControllerTest.java

示例2: 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

示例3: 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

示例4: beforeTest

import com.jayway.restassured.RestAssured; //导入方法依赖的package包/类
@Before
public void beforeTest()
{
    f.clearTestTables();
    CacheFactory.clearAllCaches();
    Database testDb = Fixtures.createTestDatabase();
    f.insertDatabase(testDb);
    Table testTable = Fixtures.createTestTable();
    f.insertTable(testTable);
    RestAssured.basePath = "/databases/" + testDb.getName() + "/tables/" + testTable.getName() + "/indexes";
}
 
开发者ID:PearsonEducation,项目名称:Docussandra,代码行数:12,代码来源:AbstractIndexControllerTest.java

示例5: 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

示例6: beforeTest

import com.jayway.restassured.RestAssured; //导入方法依赖的package包/类
@Before
public void beforeTest()
{
    f.clearTestTables();
    Database testDb = Fixtures.createTestDatabase();
    f.insertDatabase(testDb);
    RestAssured.basePath = "/databases/" + testDb.getName() + "/tables/";
}
 
开发者ID:PearsonEducation,项目名称:Docussandra,代码行数:9,代码来源:AbstractTableControllerTest.java

示例7: beforeTest

import com.jayway.restassured.RestAssured; //导入方法依赖的package包/类
@Before
public void beforeTest()
{
    f.clearTestTables();
    //clear all caches for the sake of this test, we will be creating and
    //deleting more frequently than a real world operation causing the cache
    //to hit no longer relevent objects
    CacheFactory.clearAllCaches();
    Database testDb = Fixtures.createTestDatabase();
    f.insertDatabase(testDb);
    Table testTable = Fixtures.createTestTable();
    f.insertTable(testTable);
    RestAssured.basePath = "/databases/" + testDb.getName() + "/tables/" + testTable.getName() + "/documents";
}
 
开发者ID:PearsonEducation,项目名称:Docussandra,代码行数:15,代码来源:AbstractDocumentControllerTest.java

示例8: testEnsureTestDocussandraRunningWithMockCassandra

import com.jayway.restassured.RestAssured; //导入方法依赖的package包/类
/**
 * Test of ensureTestDocussandraRunningWithMockCassandra method, of class
 * TestDocussandraManager.
 */
@Test
public void testEnsureTestDocussandraRunningWithMockCassandra() throws Exception
{
    System.out.println("ensureTestDocussandraRunningWithMockCassandra");
    //String keyspace = "docussandra";
    TestDocussandraManager instance = TestDocussandraManager.getManager();
    instance.ensureTestDocussandraRunning(true);
    RestAssured.baseURI = "http://localhost";
    RestAssured.port = 19080;
    RestAssured.basePath = "/";
    expect().statusCode(200)
            .body("isHealthy", equalTo(true))
            .get("/admin/health");
}
 
开发者ID:PearsonEducation,项目名称:Docussandra,代码行数:19,代码来源:TestDocussandraManagerTest.java

示例9: setBasePath

import com.jayway.restassured.RestAssured; //导入方法依赖的package包/类
public static void setBasePath( String basePathTerm )
{
    RestAssured.basePath = basePathTerm;
}
 
开发者ID:hemano,项目名称:cucumber-framework-java,代码行数:5,代码来源:RestUtil.java

示例10: resetBasePath

import com.jayway.restassured.RestAssured; //导入方法依赖的package包/类
public static void resetBasePath()
{
    RestAssured.basePath = null;
}
 
开发者ID:hemano,项目名称:cucumber-framework-java,代码行数:5,代码来源:RestUtil.java

示例11: postIndexAndCheckStatusTest

import com.jayway.restassured.RestAssured; //导入方法依赖的package包/类
/**
 * Tests that the POST /{databases}/{setTable}/indexes/ endpoint properly
 * creates a index and that the
 * GET/{database}/{setTable}/index_status/{status_id} endpoint is working.
 */
@Test
public void postIndexAndCheckStatusTest() throws InterruptedException
{
    Index testIndex = Fixtures.createTestIndexOneField();
    String indexStr = "{" + "\"fields\" : [\"" + testIndex.getFieldsValues().get(0)
            + "\"]," + "\"name\" : \"" + testIndex.getName() + "\"}";

    //act
    ResponseOptions response = given().body(indexStr).expect().statusCode(201)
            .body("index.name", equalTo(testIndex.getName()))
            .body("index.fields", notNullValue())
            .body("index.createdAt", notNullValue())
            .body("index.updatedAt", notNullValue())
            .body("index.active", equalTo(false))//should not yet be active
            .body("id", notNullValue())
            .body("dateStarted", notNullValue())
            .body("statusLastUpdatedAt", notNullValue())
            .body("eta", notNullValue())
            .body("percentComplete", notNullValue())
            .body("totalRecords", equalTo(0))
            .body("recordsCompleted", equalTo(0))
            .when().post("/" + testIndex.getName()).andReturn();

    Thread.sleep(100);//sleep for a hair to let the indexing complete

    String restAssuredBasePath = RestAssured.basePath;
    try
    {
        //get the uuid from the response
        String uuidString = response.getBody().jsonPath().get("id");
        RestAssured.basePath = "/databases/" + testIndex.getDatabaseName() + "/tables/" + testIndex.getTableName() + "/index_status/";
        ResponseOptions res = expect().statusCode(200)
                .body("id", equalTo(uuidString))
                .body("dateStarted", notNullValue())
                .body("statusLastUpdatedAt", notNullValue())
                .body("eta", notNullValue())
                .body("percentComplete", notNullValue())
                .body("index", notNullValue())
                .body("index.active", equalTo(true))//should now be active
                .body("totalRecords", notNullValue())
                .body("recordsCompleted", notNullValue())
                .when().get(uuidString).andReturn();//check status (index_status endpoint)
        logger.debug("Status Response: " + res.getBody().prettyPrint());
    } finally
    {
        RestAssured.basePath = restAssuredBasePath;
    }
}
 
开发者ID:PearsonEducation,项目名称:Docussandra,代码行数:54,代码来源:AbstractIndexControllerTest.java


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