String scmRootUrl = getScmRootUrl( projectGroup );
assertNotNull( scmRootUrl );
ProjectScmRoot scmRoot = getProjectScmRoot( projectGroup, scmRootUrl );
assertNotNull( scmRoot );
buildDefinition = (BuildDefinition) projectGroup.getBuildDefinitions().get( 0 );
Map<Integer, Integer> map = new HashMap<Integer, Integer>();
Project rootProject = null;
List<Project> projects = (List<Project>) projectGroup.getProjects();
for ( Project project : projects )
{
assertFalse( project.getId() == 0 );
map.put( project.getId(), buildDefinition.getId() );
if ( rootProject == null || rootProject.getId() > project.getId() )
{
rootProject = project;
}
}
assertEquals( 3, map.size() );
PrepareBuildProjectsTask task = new PrepareBuildProjectsTask( map, 1,
projectGroupId, projectGroup.getName(),
scmRoot.getScmRootAddress(), scmRoot.getId() );
return task;
}