@Test public void testAsRepositoryResponses() {

  List<RepositoryInfo> repos = Lists.newArrayList(repoInfo("HDP", "HDP-2.3", "redhat6"),
      repoInfo("HDP-UTILS", "HDP-UTILS-1.1.0.20", "redhat6"),
      repoInfo("HDP", "HDP-2.3", "redhat5"),
      repoInfo("HDP-UTILS", "HDP-UTILS-1.1.0.20", "redhat5"));
  List<RepositoryResponse> responses = RepoUtil.asResponses(repos, "HDP-2.3", "HDP", "2.3");
  Assert.assertEquals("Wrong number of responses", repos.size(), responses.size());
  for (RepositoryResponse response: responses) {
    Assert.assertEquals("Unexpected version definition id", "HDP-2.3", response.getVersionDefinitionId());
    Assert.assertEquals("Unexpected stack name", "HDP", response.getStackName());
    Assert.assertEquals("Unexpected stack version", "2.3", response.getStackVersion());
  }
}