use of com.google.gerrit.entities.RefNames in project gerrit by GerritCodeReview.
the class ProjectOperationsImpl method createNewProject.
private Project.NameKey createNewProject(TestProjectCreation projectCreation) throws Exception {
String name = projectCreation.name().orElse(RandomStringUtils.randomAlphabetic(8));
CreateProjectArgs args = new CreateProjectArgs();
args.setProjectName(name);
args.permissionsOnly = projectCreation.permissionOnly().orElse(false);
args.branch = projectCreation.branches().stream().map(RefNames::fullName).collect(toImmutableList());
args.createEmptyCommit = projectCreation.createEmptyCommit().orElse(true);
projectCreation.parent().ifPresent(p -> args.newParent = p);
// ProjectCreator wants non-null owner IDs.
args.ownerIds = new ArrayList<>(projectCreation.owners());
projectCreation.submitType().ifPresent(st -> args.submitType = st);
projectCreator.createProject(args);
return Project.nameKey(name);
}
Aggregations