@Test
public void setsLibraryDependencies() throws Exception {

  File buildFile = TestUtils.getTestDataFile(LIBRARY_DEPENDENCY_FILE);
  String content = Files.asCharSource(buildFile, UTF_8).read();
  GradleContext context = GroovyGradleParser.parseGradleBuildFile(content, 1, null).build();
  ImmutableSet<Library> expectedSet =
      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(),
          Library.newBuilder()
              .setMavenLibrary(
                  MavenLibrary.newBuilder()
                      .setGroupId("com.google.code.guice.test")
                      .setArtifactId("guice")
                      .setVersion("1.0")
                      .build())
              .build(),
          Library.newBuilder()
              .setMavenLibrary(
                  MavenLibrary.newBuilder()
                      .setGroupId("foo")
                      .setArtifactId("bar")
                      .setVersion("1.0.0")
                      .build())
              .build(),
          Library.newBuilder()
              .setMavenLibrary(
                  MavenLibrary.newBuilder()
                      .setGroupId("org.myorg")
                      .setArtifactId("someLib")
                      .setVersion("1.0")
                      .build())
              .build());
  assertThat(context.getLibraryDependencies()).hasSize(6);
  assertThat(context.getLibraryDependencies()).isEqualTo(expectedSet);
}