@Test
  public void testConvertPermissionsMap() {
    Map<String, String> map = ImmutableMap.of("/test/folder/file1", "123", "/test/file2", "456");
    assertThat(TaskCommon.convertPermissionsMap(map))
        .containsExactly(
            "/test/folder/file1",
            FilePermissions.fromOctalString("123"),
            "/test/file2",
            FilePermissions.fromOctalString("456"))
        .inOrder();

    Exception exception =
        assertThrows(
            IllegalArgumentException.class,
            () -> TaskCommon.convertPermissionsMap(ImmutableMap.of("path", "invalid permission")));
    assertThat(exception)
        .hasMessageThat()
        .isEqualTo("octalPermissions must be a 3-digit octal number (000-777)");
  }
Helper for reading back layers in a {@link BuildContext}.
jib-gradle-plugin/src/test/java/com/google/cloud/tools/jib/gradle/GradleProjectPropertiesTest.java