use of com.enonic.xp.project.Project in project xp by enonic.
the class ProjectsSyncTaskTest method syncAll.
@Test
void syncAll() {
final Project parent = createProject("parent", null);
final Project child1 = createProject("child1", "parent");
final Project child2 = createProject("child2", "child1");
when(projectService.list()).thenReturn(Projects.create().addAll(Set.of(parent, child1, child2)).build());
ProjectsSyncTask.create().projectService(projectService).syncContentService(syncContentService).build().run(TaskId.from("taskId"), mock(ProgressReporter.class, withSettings().stubOnly()));
verify(syncContentService, times(2)).syncProject(paramsCaptor.capture());
final List<ProjectName> syncProjects = paramsCaptor.getAllValues().stream().map(ProjectSyncParams::getTargetProject).collect(Collectors.toList());
assertThat(syncProjects).containsExactly(child1.getName(), child2.getName());
}
Aggregations