GradleStepdefs.java 文件源码

java
阅读 22 收藏 0 点赞 0 评论 0

项目:gradle-maven-sync-plugin 作者:
@Then("^The following dependencies are excluded from \"([^\"]*) ([^\"]*)\":$")
public void theFollowingDependenciesAreExcludedFrom(String configuration, String from, List<String> exclusions) throws Throwable {
  JsonObject reportForProject = report.getAsJsonObject(projectName);
  assertThat(reportForProject).describedAs("Report for " + projectName).isNotNull();
  for (JsonElement dependency : reportForProject.getAsJsonArray(configuration)) {
    JsonObject dependencyObject = dependency.getAsJsonObject();
    if (from.equals(dependencyObject.get("coordinates").getAsString())) {
      assertThat(dependencyObject.getAsJsonArray("excludes"))
          .extracting(JsonObject.class::cast)
          .extracting(it -> {
            String group = it.get("group").getAsString();
            JsonElement module = it.get("module");
            if (module.isJsonNull()) {
              return group;
            }
            return group + ":" + module.getAsString();
          })
          .containsAll(exclusions);
      break;
    }
  }
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号