@Test
public void testGetRepositoryNoInternetDefault() throws Exception {

  // Scenario: user has no internet and does nothing to repos via api
  // use the default
  String buildDir = tmpFolder.getRoot().getAbsolutePath();
  setupTempAmbariMetaInfoDirs(buildDir);
  // The current stack already has (HDP, 2.1.1, redhat6).
  // Deleting the json file referenced by the latestBaseUrl to simulate No
  // Internet.
  File latestUrlFile = new File(buildDir, "ambari-metaInfo/HDP/2.1.1/repos/hdp.json");
  if (System.getProperty("os.name").contains("Windows")) {
    latestUrlFile.deleteOnExit();
  }
  else {
    FileUtils.deleteQuietly(latestUrlFile);
    assertTrue(!latestUrlFile.exists());
  }
  AmbariMetaInfo ambariMetaInfo = setupTempAmbariMetaInfoExistingDirs(buildDir);
  List<RepositoryInfo> redhat6Repo = ambariMetaInfo.getRepositories(
      STACK_NAME_HDP, "2.1.1", "redhat6");
  assertNotNull(redhat6Repo);
  for (RepositoryInfo ri : redhat6Repo) {
    if (STACK_NAME_HDP.equals(ri.getRepoName())) {
      // baseUrl should be same as defaultBaseUrl since No Internet to load the
      // latestBaseUrl from the json file.
      assertEquals(ri.getBaseUrl(), ri.getDefaultBaseUrl());
    }
  }
}