Source:
<code>public void alterReplicateRegionWithParallelGatewaySenderShouldFailAndDoNotPersistChangesIntoTheClusterConfigurationService() { addIgnoredException(GatewaySenderConfigurationException.class); addIgnoredException("could not get remote locator information"); String regionName = testName.getMethodName(); String gatewaySenderId = testName.getMethodName() + "_parallelGatewaySender"; gfsh.executeAndAssertThat( <START> "create gateway-sender --parallel=true --enable-persistence=false --remote-distributed-system-id=2 --id=" <END> + gatewaySenderId) .statusIsSuccess().doesNotContainOutput("Did not complete waiting"); gfsh.executeAndAssertThat("create region --type=REPLICATE --name=" + regionName) .statusIsSuccess(); locator.waitUntilRegionIsReadyOnExactlyThisManyServers(SEPARATOR + regionName, 1); gfsh.executeAndAssertThat( "alter region --name=" + regionName + " --gateway-sender-id=" + gatewaySenderId) .statusIsError().containsOutput("server-1", "Parallel Gateway Sender " + gatewaySenderId + " can not be used with replicated region " + SEPARATOR + regionName); locator.invoke(() -> { InternalLocator internalLocator = ClusterStartupRule.getLocator(); assertThat(internalLocator).isNotNull(); CacheConfig config = internalLocator.getConfigurationPersistenceService().getCacheConfig("cluster"); RegionConfig regionConfig = find(config.getRegions(), regionName); assertThat(regionConfig).isNotNull(); assertThat(regionConfig.getRegionAttributes()).isNotNull(); assertThat(regionConfig.getRegionAttributes().getGatewaySenderIds()).isNull(); }); }</code><technical_language>tests CommandStringBuilder generate gfsh commands? I find a more readable</technical_language>

Target:
public void alterReplicateRegionWithParallelGatewaySenderShouldFailAndDoNotPersistChangesIntoTheClusterConfigurationService() { addIgnoredException(GatewaySenderConfigurationException.class); addIgnoredException("could not get remote locator information"); String regionName = testName.getMethodName(); String gatewaySenderId = testName.getMethodName() + "_parallelGatewaySender"; CommandStringBuilder createSenderBuilder = new CommandStringBuilder("create gateway-sender") .addOption("id", gatewaySenderId) .addOption("parallel", "true") .addOption("enable-persistence", "false") .addOption("remote-distributed-system-id", "2"); gfsh.executeAndAssertThat(createSenderBuilder.getCommandString()) .statusIsSuccess().doesNotContainOutput("Did not complete waiting"); CommandStringBuilder createRegionBuilder = new CommandStringBuilder("create region") .addOption("name", regionName) .addOption("type", RegionShortcut.REPLICATE.toString()); gfsh.executeAndAssertThat(createRegionBuilder.getCommandString()).statusIsSuccess(); locator.waitUntilRegionIsReadyOnExactlyThisManyServers(SEPARATOR + regionName, 1); CommandStringBuilder alterRegionBuilder = new CommandStringBuilder("alter region") .addOption("name", regionName) .addOption("gateway-sender-id", gatewaySenderId); gfsh.executeAndAssertThat(alterRegionBuilder.getCommandString()) .statusIsError() .containsOutput("server-1", "Parallel Gateway Sender " + gatewaySenderId + " can not be used with replicated region " + SEPARATOR + regionName); locator.invoke(() -> { InternalLocator internalLocator = ClusterStartupRule.getLocator(); assertThat(internalLocator).isNotNull(); CacheConfig config = internalLocator.getConfigurationPersistenceService().getCacheConfig("cluster"); RegionConfig regionConfig = find(config.getRegions(), regionName); assertThat(regionConfig).isNotNull(); assertThat(regionConfig.getRegionAttributes()).isNotNull(); assertThat(regionConfig.getRegionAttributes().getGatewaySenderIds()).isNull(); }); }