本文整理汇总了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";
}
示例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();
}
}
示例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());
}
示例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";
}
示例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();
}
示例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/";
}
示例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";
}
示例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");
}
示例9: setBasePath
import com.jayway.restassured.RestAssured; //导入方法依赖的package包/类
public static void setBasePath( String basePathTerm )
{
RestAssured.basePath = basePathTerm;
}
示例10: resetBasePath
import com.jayway.restassured.RestAssured; //导入方法依赖的package包/类
public static void resetBasePath()
{
RestAssured.basePath = null;
}
示例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;
}
}