geode-wan/src/test/java/org/apache/geode/internal/cache/wan/wancommand/StopGatewayReceiverCommandDUnitTest.java
@Test
  public void testStopGatewayReceiver_ErrorConditions() {
    VM puneLocator = Host.getLocator();
    int dsIdPort = puneLocator.invoke(this::getLocatorPort);
    propsSetUp(dsIdPort);

    vm2.invoke(() -> createFirstRemoteLocator(2, dsIdPort));
    vm3.invoke(() -> createReceiver(dsIdPort));

    final DistributedMember vm1Member = vm3.invoke(this::getMember);
    String command = CliStrings.STOP_GATEWAYRECEIVER + " --" + CliStrings.MEMBER + "="
        + vm1Member.getId() + " --" + CliStrings.GROUP + "=RG1";
    CommandResult cmdResult = executeCommand(command);
    if (cmdResult != null) {
      String strCmdResult = commandResultToString(cmdResult);
      getLogWriter()
          .info("testStopGatewayReceiver_ErrorConditions stringResult : " + strCmdResult + ">>>>");
      assertEquals(Result.Status.ERROR, cmdResult.getStatus());
      assertTrue(strCmdResult.contains(CliStrings.PROVIDE_EITHER_MEMBER_OR_GROUP_MESSAGE));
    } else {
      fail("testStopGatewayReceiver_ErrorConditions failed as did not get CommandResult");
    }
  }
/**
   * Test wan commands for error in input 1> start gateway-sender command needs only one of member
   * or group.
   */
Test wan commands for error in input 1> start gateway-sender command needs only one of member
or group.
Test wan commands for error in input 1 > start gateway - sender command needs only one of member or group .
@Test
  public void testStopGatewayReceiver_ErrorConditions() {
    VM puneLocator = Host.getLocator();
    int dsIdPort = puneLocator.invoke(this::getLocatorPort);
    propsSetUp(dsIdPort);
    vm2.invoke(() -> createFirstRemoteLocator(2, dsIdPort));
    vm3.invoke(() -> createReceiver(dsIdPort));
    final DistributedMember vm1Member = vm3.invoke(this::getMember);
    String command = CliStrings.STOP_GATEWAYRECEIVER + " --" + CliStrings.MEMBER + "="
        + vm1Member.getId() + " --" + CliStrings.GROUP + "=RG1";
    CommandResult cmdResult = executeCommand(command);
    if (cmdResult != null) {
      String strCmdResult = commandResultToString(cmdResult);
      getLogWriter()
          .info("testStopGatewayReceiver_ErrorConditions stringResult : " + strCmdResult + ">>>>");
      assertEquals(Result.Status.ERROR, cmdResult.getStatus());
      assertTrue(strCmdResult.contains(CliStrings.PROVIDE_EITHER_MEMBER_OR_GROUP_MESSAGE));
    } else {
      fail("testStopGatewayReceiver_ErrorConditions failed as did not get CommandResult");
    }
  }
@ Test public void testStopGatewayReceiver_ErrorConditions ( ) { VM puneLocator = Host . getLocator ( ) ; int dsIdPort = puneLocator . invoke ( this :: getLocatorPort ) ; propsSetUp ( dsIdPort ) ; vm2 . invoke ( ( ) -> createFirstRemoteLocator ( 2 , dsIdPort ) ) ; vm3 . invoke ( ( ) -> createReceiver ( dsIdPort ) ) ; final DistributedMember vm1Member = vm3 . invoke ( this :: getMember ) ; String command = CliStrings . STOP_GATEWAYRECEIVER + " --" + CliStrings . MEMBER + "=" + vm1Member . getId ( ) + " --" + CliStrings . GROUP + "=RG1" ; CommandResult cmdResult = executeCommand ( command ) ; if ( cmdResult != null ) { String strCmdResult = commandResultToString ( cmdResult ) ; getLogWriter ( ) . info ( "testStopGatewayReceiver_ErrorConditions stringResult : " + strCmdResult + ">>>>" ) ; assertEquals ( Result . Status . ERROR , cmdResult . getStatus ( ) ) ; assertTrue ( strCmdResult . contains ( CliStrings . PROVIDE_EITHER_MEMBER_OR_GROUP_MESSAGE ) ) ; } else { fail ( "testStopGatewayReceiver_ErrorConditions failed as did not get CommandResult" ) ; } }
Test wan commands for error in input 1> start gateway-sender command needs only one of member
 or group.
Test wan commands for error in input 1 > start gateway - sender command needs only one of member or group .