public static GlobalConfig readConfig() throws IOException, InvalidGlobalConfigException {
    return readConfig(getConfigDir());
  }
@Test
  public void testReadConfig() throws IOException, InvalidGlobalConfigException {
    String json =
        "{\"disableUpdateCheck\":true, \"registryMirrors\":["
            + "{ \"registry\": \"registry-1.docker.io\","
            + "  \"mirrors\": [\"mirror.gcr.io\", \"localhost:5000\"] },"
            + "{ \"registry\": \"another.registry\", \"mirrors\": [\"another.mirror\"] }"
            + "]}";
    Files.write(configDir.resolve("config.json"), json.getBytes(StandardCharsets.UTF_8));

    GlobalConfig globalConfig = GlobalConfig.readConfig(configDir);
    assertThat(globalConfig.isDisableUpdateCheck()).isTrue();
    assertThat(globalConfig.getRegistryMirrors())
        .containsExactly(
            "registry-1.docker.io",
            "mirror.gcr.io",
            "registry-1.docker.io",
            "localhost:5000",
            "another.registry",
            "another.mirror");
  }