@Test
public void testEnvironmentWithPeer() {

  HAServiceTarget target = new DummyHAService(HAServiceState.ACTIVE,
      new InetSocketAddress("dummytarget", 1111));
  HAServiceTarget source = new DummyHAService(HAServiceState.STANDBY,
      new InetSocketAddress("dummysource", 2222));
  target.setTransitionTargetHAStatus(HAServiceState.ACTIVE);
  source.setTransitionTargetHAStatus(HAServiceState.STANDBY);
  String cmd = "echo $target_host $target_port,"
      + "echo $source_host $source_port";
  if (!Shell.WINDOWS) {
    fencer.tryFence(target, cmd);
    Mockito.verify(ShellCommandFencer.LOG).info(
        Mockito.contains("echo $ta...rget_port: dummytarget 1111"));
    fencer.tryFence(source, cmd);
    Mockito.verify(ShellCommandFencer.LOG).info(
        Mockito.contains("echo $so...urce_port: dummysource 2222"));
  } else {
    fencer.tryFence(target, cmd);
    Mockito.verify(ShellCommandFencer.LOG).info(
        Mockito.contains("echo %ta...get_port%: dummytarget 1111"));
    fencer.tryFence(source, cmd);
    Mockito.verify(ShellCommandFencer.LOG).info(
        Mockito.contains("echo %so...urce_port%: dummysource 2222"));
  }
}