@Test
  public void testCreateGatewayReceiverErrorWhenGatewayReceiverAlreadyExists() {
    Integer locator1Port = locatorSite1.getPort();
    server1 = clusterStartupRule.startServerVM(1, locator1Port);
    server2 = clusterStartupRule.startServerVM(2, locator1Port);
    server3 = clusterStartupRule.startServerVM(3, locator1Port);

    // Initial Creation should succeed
    String command =
        CliStrings.CREATE_GATEWAYRECEIVER + " --" + CliStrings.CREATE_GATEWAYRECEIVER__BINDADDRESS
            + "=localhost" + " --" + CliStrings.CREATE_GATEWAYRECEIVER__STARTPORT + "=10000" + " --"
            + CliStrings.CREATE_GATEWAYRECEIVER__ENDPORT + "=11000" + " --"
            + CliStrings.CREATE_GATEWAYRECEIVER__MAXTIMEBETWEENPINGS + "=100000" + " --"
            + CliStrings.CREATE_GATEWAYRECEIVER__SOCKETBUFFERSIZE + "=512000";
    gfsh.executeAndAssertThat(command).statusIsSuccess()
        .tableHasColumnWithExactValuesInAnyOrder("Member", SERVER_1, SERVER_2, SERVER_3)
        .tableHasColumnWithValuesContaining("Message",
            "GatewayReceiver created on member \"" + SERVER_1 + "\"",
            "GatewayReceiver created on member \"" + SERVER_2 + "\"",
            "GatewayReceiver created on member \"" + SERVER_3 + "\"");

    invokeInEveryMember(
        () -> verifyReceiverCreationWithAttributes(!GatewayReceiver.DEFAULT_MANUAL_START, 10000,
            11000, "localhost", 100000, 512000, null, GatewayReceiver.DEFAULT_HOSTNAME_FOR_SENDERS),
        server1, server2, server3);

    // This should fail as there's already a gateway receiver created on the member.
    gfsh.executeAndAssertThat(command).statusIsError()
        .tableHasColumnWithExactValuesInAnyOrder("Member", SERVER_1, SERVER_2, SERVER_3)
        .tableHasColumnWithExactValuesInAnyOrder("Status", "ERROR", "ERROR", "ERROR")
        .tableHasColumnWithExactValuesInAnyOrder("Message",
            " java.lang.IllegalStateException: " + A_GATEWAY_RECEIVER_ALREADY_EXISTS_ON_THIS_MEMBER,
            " java.lang.IllegalStateException: " + A_GATEWAY_RECEIVER_ALREADY_EXISTS_ON_THIS_MEMBER,
            " java.lang.IllegalStateException: "
                + A_GATEWAY_RECEIVER_ALREADY_EXISTS_ON_THIS_MEMBER);
  }
GatewayReceiver with given attributes. Error scenario where the user tries to create more than
one receiver per member.
geode-wan/src/distributedTest/java/org/apache/geode/internal/cache/wan/wancommand/CreateGatewayReceiverCommandDUnitTest.java