本文整理汇总了Java中com.jayway.restassured.specification.RequestSpecification.queryParam方法的典型用法代码示例。如果您正苦于以下问题:Java RequestSpecification.queryParam方法的具体用法?Java RequestSpecification.queryParam怎么用?Java RequestSpecification.queryParam使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.jayway.restassured.specification.RequestSpecification
的用法示例。
在下文中一共展示了RequestSpecification.queryParam方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: searchRequest
import com.jayway.restassured.specification.RequestSpecification; //导入方法依赖的package包/类
public RequestSpecification searchRequest(String nodes, String nest, boolean getItems, String query, String filter,
String order)
{
RequestSpecification request = successfulRequest();
request.queryParam("nodes", nodes);
request.queryParam("getitems", getItems);
if( nest != null )
{
request.queryParam("nest", nest);
}
if( query != null )
{
request.param("q", query);
}
if( filter != null )
{
request = request.queryParam("filter", filter);
}
if( order != null )
{
request = request.queryParam("order", order);
}
return request;
}
示例2: searchRequest
import com.jayway.restassured.specification.RequestSpecification; //导入方法依赖的package包/类
public RequestSpecification searchRequest(String query, String filter, String order, String length)
{
RequestSpecification request = successfulRequest().param("q", query);
if( filter != null )
{
request = request.queryParam("filter", filter);
}
if( order != null )
{
request = request.queryParam("order", order);
}
if( length != null )
{
request = request.queryParam("length", length);
}
return request;
}
示例3: getDetails
import com.jayway.restassured.specification.RequestSpecification; //导入方法依赖的package包/类
/**
* Return the details of a preparation at a given (optional) step.
*
* @param preparationId the wanted preparation id.
* @param wantedStepId the optional wanted step id.
* @return the details of a preparation at a given (optional) step.
*/
public PreparationMessage getDetails(String preparationId, String wantedStepId) {
final RequestSpecification specs = given();
if (StringUtils.isNotBlank(wantedStepId)) {
specs.queryParam("stepId", wantedStepId);
}
final Response response = specs.when().get("/preparations/{id}/details", preparationId);
if (response.getStatusCode() != 200) {
throw new MockTDPException(response);
}
try {
return mapper.readerFor(PreparationMessage.class).readValue(response.asString());
} catch (IOException e) {
throw new TDPException(UNABLE_TO_READ_CONTENT);
}
}
示例4: createPreparationFromDataset
import com.jayway.restassured.specification.RequestSpecification; //导入方法依赖的package包/类
/**
* Create an empty preparation from a dataset.
*
* @param dataSetId the dataset id to create the preparation from.
* @param name the preparation name.
* @param folderId where to create the preparation.
* @return the preparation id.
* @throws IOException sh*t happens.
*/
public String createPreparationFromDataset(final String dataSetId, final String name, final String folderId)
throws IOException {
RequestSpecification request = given() //
.contentType(JSON) //
.body("{ \"name\": \"" + name + "\", \"dataSetId\": \"" + dataSetId + "\"}");
if (folderId != null) {
request = request.queryParam("folder", folderId);
}
final Response response = request //
.when() //
.expect().statusCode(200).log().ifError() //
.post("/api/preparations");
assertThat(response.getStatusCode(), is(200));
final String preparationId = response.asString();
assertThat(preparationId, notNullValue());
assertThat(preparationId, not(""));
return preparationId;
}
示例5: searchRequest
import com.jayway.restassured.specification.RequestSpecification; //导入方法依赖的package包/类
public RequestSpecification searchRequest(String query, String type)
{
RequestSpecification request = successfulRequest().param("q", query);
if( type != null )
{
request = request.queryParam("type", type);
}
return request;
}
示例6: createRequest
import com.jayway.restassured.specification.RequestSpecification; //导入方法依赖的package包/类
public RequestSpecification createRequest(ObjectNode object, Object waitForIndex)
{
RequestSpecification request = createRequest(object);
if( waitForIndex != null )
{
request.queryParam("waitforindex", waitForIndex);
}
return request;
}
示例7: submit
import com.jayway.restassured.specification.RequestSpecification; //导入方法依赖的package包/类
public ObjectNode submit(ItemId itemId, String message)
{
RequestSpecification request = actionSuccess();
if( message != null )
{
request = request.queryParam("message", message);
}
return action(request, itemId, "submit");
}
示例8: importer
import com.jayway.restassured.specification.RequestSpecification; //导入方法依赖的package包/类
public Response importer(ObjectNode object, String stagingId)
{
RequestSpecification req = importRequest(object);
if( stagingId != null )
{
req = req.queryParam("file", stagingId);
}
return importer(req);
}
示例9: search
import com.jayway.restassured.specification.RequestSpecification; //导入方法依赖的package包/类
public ObjectNode search(String query)
{
RequestSpecification request = auth().expect().statusCode(501).with();
request.queryParam("q", query);
if( isEquella() )
{
return object(request.get(getResolvedPath()));
}
// else
return object(request.get(getResolvedPath() + "/search"));
}
示例10: rejectRequest
import com.jayway.restassured.specification.RequestSpecification; //导入方法依赖的package包/类
public RequestSpecification rejectRequest(RequestSpecification request, String toTask)
{
if( toTask != null )
{
request = request.queryParam("to", toTask);
}
return request;
}
示例11: actionRequest
import com.jayway.restassured.specification.RequestSpecification; //导入方法依赖的package包/类
private RequestSpecification actionRequest(RequestSpecification request, String message)
{
if( message != null )
{
request = request.queryParam("message", message);
}
return request;
}
示例12: searchRequest
import com.jayway.restassured.specification.RequestSpecification; //导入方法依赖的package包/类
public RequestSpecification searchRequest(String query, String order)
{
RequestSpecification request = successfulRequest().param("q", query);
if( order != null )
{
request = request.queryParam("order", order);
}
return request;
}
示例13: export
import com.jayway.restassured.specification.RequestSpecification; //导入方法依赖的package包/类
public ObjectNode export()
{
RequestSpecification request = successfulRequest();
request.queryParam("export", true);
if( isEquella() )
{
return object(request.get(getResolvedPath()));
}
// else
return object(request.get(getResolvedPath() + "/search"));
}
示例14: search
import com.jayway.restassured.specification.RequestSpecification; //导入方法依赖的package包/类
public ObjectNode search(String query)
{
RequestSpecification request = auth().expect().statusCode(200).with();
request.queryParam("q", query);
return object(request.get(getResolvedPath() + "/search"));
}
示例15: export
import com.jayway.restassured.specification.RequestSpecification; //导入方法依赖的package包/类
public ObjectNode export()
{
RequestSpecification request = successfulRequest();
request.queryParam("export", true);
return object(request.get(getResolvedPath() + "/"));
}