本文整理汇总了Java中cucumber.api.DataTable.asList方法的典型用法代码示例。如果您正苦于以下问题:Java DataTable.asList方法的具体用法?Java DataTable.asList怎么用?Java DataTable.asList使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类cucumber.api.DataTable
的用法示例。
在下文中一共展示了DataTable.asList方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: add_items
import cucumber.api.DataTable; //导入方法依赖的package包/类
@When("^I add the following items$")
public void add_items(final DataTable table) throws Throwable {
for (final String item : table.asList(String.class)) {
input(item, "itemToAdd");
click_button("Add");
}
}
示例2: iShouldNotSeeHeaders
import cucumber.api.DataTable; //导入方法依赖的package包/类
@Then("^I should not see headers:$")
public void iShouldNotSeeHeaders(DataTable headersTable) throws Throwable {
List<String> headers = headersTable.asList(String.class);
for (String header : headers) {
assertNull("Header should not be displayed", sitePage.findElementWithText(header));
}
}
示例3: iShouldSeeHeaders
import cucumber.api.DataTable; //导入方法依赖的package包/类
@Then("^I should see headers:$")
public void iShouldSeeHeaders(DataTable headersTable) throws Throwable {
List<String> headers = headersTable.asList(String.class);
for (String header : headers) {
assertNotNull("Header should be displayed: " + header, sitePage.findElementWithText(header));
}
}
示例4: db
import cucumber.api.DataTable; //导入方法依赖的package包/类
@Given("^I have the redis list \"([^\"]*)\"(?: in the db (\\d+))? with values:$")
public void iHaveTheRedisListInTheDbWithValues(final String list, final Integer db,
final DataTable dataTable) throws Throwable {
final Jedis jedis = RedisUtil.getJedis(db);
final List<String> table = dataTable.asList(String.class);
jedis.lpush(list, table.toArray(new String[table.size()]));
jedis.close();
}
示例5: lists
import cucumber.api.DataTable; //导入方法依赖的package包/类
@Then("^the redis lists(?: in the db (\\d+))? should exists:$")
public void theRedisListsInTheDbShouldExists(final Integer db, final DataTable dataTable)
throws Throwable {
final Jedis jedis = RedisUtil.getJedis(db);
for (final String key : dataTable.asList(String.class)) {
assertThat(jedis.exists(key)).isTrue();
}
jedis.close();
}
示例6: keys
import cucumber.api.DataTable; //导入方法依赖的package包/类
@Then("^the redis keys(?: in the db (\\d+))? should exists:$")
public void theRedisKeysInTheDbShouldExistsColon(final Integer db, final DataTable dataTable)
throws Throwable {
for (final String key : dataTable.asList(String.class)) {
this.theRedisKeysInTheDbShouldExists(key, db);
}
}
示例7: theCallToExternalServiceShouldBe
import cucumber.api.DataTable; //导入方法依赖的package包/类
@Given("^The call to external service should be:$")
public void theCallToExternalServiceShouldBe(final DataTable data) throws Throwable {
final List<Call> calls = data.asList(Call.class);
for (final Call call : calls) {
stubHttp.match(call.getHttpMethod(), call.buildQueryParams()).then(
status(HttpStatus.getHttpStatus(call.getStatusCode())),
resourceContent(Thread.currentThread().getContextClassLoader()
.getResource("fixtures/" + call.getFilename())));
}
}
示例8: db
import cucumber.api.DataTable; //导入方法依赖的package包/类
@Given("^I have the redis list \"([^\"]*)\"(?: in the db (\\d+))? with values:$")
public void I_have_the_redis_list_with_values(final String list, final Integer db,
final DataTable dataTable) throws Throwable {
final Jedis jedis = getJedis(db);
final List<String> table = dataTable.asList(String.class);
jedis.lpush(list, table.toArray(new String[table.size()]));
jedis.close();
}
示例9: lists
import cucumber.api.DataTable; //导入方法依赖的package包/类
@Then("^the redis lists(?: in the db (\\d+))? should exists:$")
public void the_redis_lists_should_exists(final Integer db, final DataTable dataTable)
throws Throwable {
final Jedis jedis = getJedis(db);
for (final String key : dataTable.asList(String.class)) {
assertThat(jedis.exists(key)).isTrue();
}
jedis.close();
}
示例10: the_call_to_external_service_should_be
import cucumber.api.DataTable; //导入方法依赖的package包/类
@Given("^The call to external service should be:$")
public void the_call_to_external_service_should_be(final DataTable data) throws Throwable {
final List<Call> calls = data.asList(Call.class);
for (final Call call : calls) {
stubHttp.match(call.getHttpMethod(), call.buildQueryParams()).then(
status(HttpStatus.getHttpStatus(call.getStatusCode())),
resourceContent(Thread.currentThread().getContextClassLoader()
.getResource("fixtures/" + call.getFilename())));
}
}
示例11: keys
import cucumber.api.DataTable; //导入方法依赖的package包/类
@Then("^the redis keys(?: in the db (\\d+))? should exists:$")
public void the_redis_keys_should_exists(final Integer db, final DataTable dataTable)
throws Throwable {
for (final String key : dataTable.asList(String.class)) {
this.the_redis_keys_should_exists(key, db);
}
}
示例12: existingPortfolioImport
import cucumber.api.DataTable; //导入方法依赖的package包/类
@Given("^an existing portfolio for affiliate \"(.*?)\" and partyCode \"(.*?)\" and currency \"(.*?)\" like$")
public void existingPortfolioImport(final String affiliateCode, final String partyCode, final String ccy, final DataTable dataTable)
throws Throwable {
portfolio = new BasicPortfolio();
portfolio.setAffiliateCode(affiliateCode);
portfolio.setPartyCode(partyCode);
portfolio.setPortfolioCcy(ccy);
final List<BasicLine> details = dataTable.asList(BasicLine.class);
final List<ExistingPortfolioLine> lines = new ArrayList<>();
lines.addAll(details);
portfolio.setLines(lines);
portfolio.setPortfolioValue(lines.stream().map(t -> t.getValueInPortfolioCcy()).reduce(BigDecimal.ZERO, (a, b) -> b != null ? a.add(b) : a));
}
示例13: checkMessage
import cucumber.api.DataTable; //导入方法依赖的package包/类
@Then("^the following messages should be available$")
public void checkMessage(final DataTable table) {
final HashSet<String> expected = new HashSet<>(table.asList(String.class));
final Set<String> actual = messageFacade.getMessages();
assertThat(actual, is(equalTo(expected)));
}
示例14: The_consumer_should_have_received_the_following_messages
import cucumber.api.DataTable; //导入方法依赖的package包/类
@Then("^The consumer should have received the following messages:$")
public void The_consumer_should_have_received_the_following_messages(DataTable expected) throws Throwable {
List<String> expectedMessages = expected.asList(String.class);
RecordingMessageListener recorder = recorderForConsumer(theOnlyConsumerExisting());
LinkedList<Message<String>> receivedMessages = recorder.getRecordedMessages();
assertThat(receivedMessages.size(), is(expectedMessages.size()));
for (String expectedMessage : expectedMessages) {
List<Message<String>> messages = recorder.extractRecordedMessagesWithContent(expectedMessage);
assertThat(messages.size(), is(1));
}
}
示例15: a_board_with_messages
import cucumber.api.DataTable; //导入方法依赖的package包/类
@Given("^a board with messages:$")
public void a_board_with_messages(DataTable table) throws Throwable {
board.clear();
for (Object msg : table.asList(String.class))
board.postMessage((String) msg);
}