BuildTypesDependencyAnalyzer implements DependenciesAnalyzer<BuildDependenciesResult> { public BuildDependenciesResult analyzeDependencies(SBuildType buildType) { MavenDependenciesResult mavenResult = mavenBuildAnalyzer.analyzeDependencies(buildType); if (mavenResult.getResultType().hasDependencies()) return analyzeBuildTypeDependencies(buildType, mavenResult); else return toBuildDependenciesResult(mavenResult, buildType); } BuildTypesDependencyAnalyzer(MavenBuildTypeDependenciesAnalyzer mavenBuildAnalyzer,
                                        BuildTypeDependenciesDecorator dependenciesDecorator,
                                        BuildPlanAnalyzer buildPlanAnalyzer,
                                        BuildTypeDependenciesExtractor buildTypeDependenciesExtractor,
                                        DependenciesDao dependenciesDao); BuildDependenciesResult getBuildDependencies(SBuildType buildType); BuildDependenciesResult getBuildDependencies(SBuildType buildType, boolean checkForNewerRevision); BuildDependenciesResult analyzeDependencies(SBuildType buildType); BuildDependenciesResult forceAnalyzeDependencies(SBuildType buildType); CollectProgress getProgress(String buildTypeId, Integer position);  }
@Test public void testAnalyzeDependencies_Delegate() throws Exception { when(mavenBuildAnalyzer.analyzeDependencies(buildType)).thenReturn(new MavenDependenciesResult(ResultType.runningAsync)); assertThat(analyzer.analyzeDependencies(buildType).getResultType(), is(ResultType.runningAsync)); }