cucumber.api.DataTable.asList()方法的使用及代码示例

x33g5p2x  于2022-01-18 转载在 其他  
字(3.2k)|赞(0)|评价(0)|浏览(116)

本文整理了Java中cucumber.api.DataTable.asList()方法的一些代码示例,展示了DataTable.asList()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。DataTable.asList()方法的具体详情如下:
包路径:cucumber.api.DataTable
类名称:DataTable
方法名:asList

DataTable.asList介绍

暂无

代码示例

代码示例来源:origin: Appendium/objectlabkit

public static <T> List<T> convertDataTable(final DataTable table, final Class<T> typeOfT, final List<String> propertiesToCopy) {
  return table.asList(typeOfT).stream().map(t -> copyFields(t, typeOfT, propertiesToCopy)).collect(Collectors.toList());
}

代码示例来源:origin: alien4cloud/alien4cloud

private List<LocationPolicySetting> convert(DataTable expectedSettings) {
  List<List<String>> raw = Lists.newArrayList(expectedSettings.raw());
  raw.add(0, Lists.newArrayList("groupName", "orchestratorName", "locationName"));
  DataTable toCenvert = expectedSettings.toTable(raw);
  return toCenvert.asList(LocationPolicySetting.class);
}

代码示例来源:origin: alien4cloud/alien4cloud

private List<SubstitutionSetting> convertSubtitution(DataTable expectedSettings) {
  List<List<String>> raw = Lists.newArrayList(expectedSettings.raw());
  raw.add(0, Lists.newArrayList("templateNme", "resourceName", "resourceType"));
  DataTable toConvert = expectedSettings.toTable(raw);
  return toConvert.asList(SubstitutionSetting.class);
}

代码示例来源:origin: com.foreach.cwb/cwb-core

@Then("^ensure that \"([^\"]*)\" (?:contains|should contain):$")
public void ensure_that_contains( String spelExpressionOne, DataTable dataTable ) throws Throwable {
  Object entity = spel.getValue( spelExpressionOne );
  int numberOfCells = dataTable.topCells().size();
  if ( numberOfCells != 1 && numberOfCells != 2 ) {
    fail( "should not contain only supports tables of 1 or 2 columns" );
  }
  Map<String, String> values = new HashMap<String, String>();
  if ( numberOfCells == 1 ) {
    List<String> datatablecells = dataTable.asList( String.class );
    for ( String cell : datatablecells ) {
      values.put( cell, null );
    }
  }
  if ( numberOfCells == 2 ) {
    values = dataTable.asMap( String.class, String.class );
  }
  Map entities = new BeanMap( entity );
  mapChecker.contains( entities, values, true );
}

代码示例来源:origin: org.apache.james/james-server-jmap-integration-testing

private void assertAttachment(String attachment, DataTable attachmentProperties) {
  attachmentProperties.asList(TableRow.class)
    .forEach(entry -> assertThat(httpClient.jsonPath.<Object>read(attachment + "." + entry.getKey())).isEqualTo(entry.getValue()));
}

代码示例来源:origin: Appendium/objectlabkit

@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));
}

相关文章