@Test
  public void testGetProjectDependencies() {
    MavenProject rootPomProject = mock(MavenProject.class);
    MavenProject jibSubModule = mock(MavenProject.class);
    MavenProject sharedLibSubModule = mock(MavenProject.class);
    when(mockMavenSession.getProjects())
        .thenReturn(Arrays.asList(rootPomProject, sharedLibSubModule, jibSubModule));

    Artifact nullFileArtifact = mock(Artifact.class);
    Artifact projectJar = newArtifact("com.test", "my-app", "1.0");
    Artifact sharedLibJar = newArtifact("com.test", "shared-lib", "1.0");

    when(rootPomProject.getArtifact()).thenReturn(nullFileArtifact);
    when(jibSubModule.getArtifact()).thenReturn(projectJar);
    when(sharedLibSubModule.getArtifact()).thenReturn(sharedLibJar);

    when(mockMavenProject.getArtifact()).thenReturn(projectJar);

    assertThat(mavenProjectProperties.getProjectDependencies()).containsExactly(sharedLibJar);
  }
Helper for reading back layers in a {@link BuildContext}.
jib-maven-plugin/src/test/java/com/google/cloud/tools/jib/maven/MavenProjectPropertiesTest.java