@Test
public void testMatchingVersions() throws Exception {

  StackId sourceStack = HDP_21_STACK;
  StackId targetStack = HDP_21_STACK;
  String sourceRepo = HDP_2_1_1_0;
  String targetRepo = HDP_2_1_1_1;
  makeUpgradeCluster(sourceStack, sourceRepo, targetStack, targetRepo);
  // Verify the repo before calling Finalize
  AmbariMetaInfo metaInfo = m_injector.getInstance(AmbariMetaInfo.class);
  RepositoryInfo repo = metaInfo.getRepository(sourceStack.getStackName(), sourceStack.getStackVersion(), "redhat6", sourceStack.getStackId());
  assertEquals(HDP_211_CENTOS6_REPO_URL, repo.getBaseUrl());
  // Finalize the upgrade
  Map<String, String> commandParams = new HashMap<String, String>();
  commandParams.put(FinalizeUpgradeAction.UPGRADE_DIRECTION_KEY, "upgrade");
  commandParams.put(FinalizeUpgradeAction.VERSION_KEY, targetRepo);
  ExecutionCommand executionCommand = new ExecutionCommand();
  executionCommand.setCommandParams(commandParams);
  executionCommand.setClusterName("c1");
  HostRoleCommand hostRoleCommand = hostRoleCommandFactory.create(null, null, null, null);
  hostRoleCommand.setExecutionCommandWrapper(new ExecutionCommandWrapper(executionCommand));
  ComponentVersionCheckAction action = m_injector.getInstance(ComponentVersionCheckAction.class);
  action.setExecutionCommand(executionCommand);
  action.setHostRoleCommand(hostRoleCommand);
  CommandReport report = action.execute(null);
  assertNotNull(report);
  assertEquals(HostRoleStatus.COMPLETED.name(), report.getStatus());
  assertEquals(0, report.getExitCode());
}