@Test
public void analyze_iteratesOverAppProject() throws Exception {

  ProjectAnalyzer analyzer = new ProjectAnalyzer(testProjectSuggesters, testSuggesters);
  File appProject = TestUtils.getTestDataFile(APP_PROJECT);
  GradleContext context =
      GradleContext.builder()
          .setMinSdkVersion(15)
          .setOnDemand(false)
          .setPluginType(GradleContext.PluginType.APPLICATION)
          .setProguardConfigs(
              ImmutableMap.of(
                  "release",
                  ProguardConfig.builder()
                      .setMinifyEnabled(false)
                      .setHasProguardRules(true)
                      .build()))
          .setLibraryDependencies(
              ImmutableSet.of(
                  Library.newBuilder()
                      .setMavenLibrary(
                          MavenLibrary.newBuilder()
                              .setGroupId("com.google.inject")
                              .setArtifactId("guice")
                              .setVersion("3.0")
                              .build())
                      .build(),
                  Library.newBuilder()
                      .setMavenLibrary(
                          MavenLibrary.newBuilder()
                              .setGroupId("com.android.support.constraint")
                              .setArtifactId("constraint-layout")
                              .setVersion("1.1.3")
                              .build())
                      .build(),
                  Library.newBuilder()
                      .setMavenLibrary(
                          MavenLibrary.newBuilder()
                              .setGroupId("com.android.support")
                              .setArtifactId("appcompat-v7")
                              .setVersion("28.0.0")
                              .build())
                      .build()))
          .setBundleConfig(
              BundleConfig.builder()
                  .setBundleConfigLocation(BundleConfigLocation.builder().build())
                  .build())
          .build();
  Suggestion stubSuggestion =
      Suggestion.create(
          Suggestion.IssueType.WEBP,
          Suggestion.Category.WEBP,
          Payload.getDefaultInstance(),
          "Stub Suggestion",
          /* estimatedBytesSaved= */ null,
          /* autoFix= */ null);
  Suggestion stubArtifactSuggestion =
      Suggestion.create(
          Suggestion.IssueType.PROGUARD_NO_OBFUSCATION,
          Suggestion.Category.PROGUARD,
          Payload.getDefaultInstance(),
          "Stub Artifact Suggestion",
          /* estimatedBytesSaved= */ null,
          /* autoFix= */ null);
  suggester.setArtifactSuggestions(ImmutableMultimap.of(context, stubArtifactSuggestion));
  suggester.setEntrySuggestions(
      ImmutableMultimap.of(
          ContextAndEntryPath.create(context, "src/main/AndroidManifest.xml"), stubSuggestion));
  ImmutableList<Suggestion> suggestions = analyzer.analyze(appProject);
  assertThat(suggestions).containsExactly(stubSuggestion, stubArtifactSuggestion);
  assertThat(suggester.getAnalyzedEntries())
      .containsExactlyElementsIn(filesUnderDirectory(appProject.toPath()));
}