geode-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jinmeil...@apache.org
Subject [geode] branch develop updated: GEODE-5971: remove unnecessary @VisibleToTest methods (#3505)
Date Fri, 26 Apr 2019 21:45:13 GMT
This is an automated email from the ASF dual-hosted git repository.

jinmeiliao pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/geode.git


The following commit(s) were added to refs/heads/develop by this push:
     new 0a9a097  GEODE-5971: remove unnecessary @VisibleToTest methods (#3505)
0a9a097 is described below

commit 0a9a097fffef93df85f043108de6f9d2ca5945b7
Author: jinmeiliao <jiliao@pivotal.io>
AuthorDate: Fri Apr 26 14:45:00 2019 -0700

    GEODE-5971: remove unnecessary @VisibleToTest methods (#3505)
---
 .../CreateDefinedIndexesCommandDUnitTest.java      |  74 +++++-----
 .../commands/DescribeMembersCommandDUnitTest.java  |   3 +-
 .../cli/commands/DiskStoreCommandsDUnitTest.java   |  54 ++++---
 .../commands/ListJndiBindingCommandDUnitTest.java  |  26 ++--
 .../cli/commands/ListMembersCommandDUnitTest.java  |  16 +--
 .../cli/commands/LocateEntryDUnitTest.java         |  44 +++---
 .../cli/commands/GetCommandIntegrationTest.java    | 158 ++++++++++-----------
 .../cli/commands/PutCommandIntegrationTest.java    |  60 ++++----
 .../internal/cli/remote/CommandExecutor.java       |   7 +-
 .../internal/cli/result/CommandResult.java         |  41 ------
 .../commands/CreateDefinedIndexesCommandTest.java  |  14 +-
 11 files changed, 204 insertions(+), 293 deletions(-)

diff --git a/geode-core/src/distributedTest/java/org/apache/geode/management/internal/cli/commands/CreateDefinedIndexesCommandDUnitTest.java
b/geode-core/src/distributedTest/java/org/apache/geode/management/internal/cli/commands/CreateDefinedIndexesCommandDUnitTest.java
index f67ae66..71cb79b 100644
--- a/geode-core/src/distributedTest/java/org/apache/geode/management/internal/cli/commands/CreateDefinedIndexesCommandDUnitTest.java
+++ b/geode-core/src/distributedTest/java/org/apache/geode/management/internal/cli/commands/CreateDefinedIndexesCommandDUnitTest.java
@@ -19,7 +19,6 @@ import static org.apache.geode.management.internal.cli.result.model.ResultModel.
 import static org.assertj.core.api.Assertions.assertThat;
 
 import java.util.List;
-import java.util.Map;
 import java.util.stream.Collectors;
 
 import org.junit.Before;
@@ -38,8 +37,6 @@ import org.apache.geode.cache.query.QueryService;
 import org.apache.geode.distributed.Locator;
 import org.apache.geode.distributed.internal.InternalConfigurationPersistenceService;
 import org.apache.geode.distributed.internal.InternalLocator;
-import org.apache.geode.management.cli.Result;
-import org.apache.geode.management.internal.cli.result.CommandResult;
 import org.apache.geode.test.dunit.rules.ClusterStartupRule;
 import org.apache.geode.test.dunit.rules.MemberVM;
 import org.apache.geode.test.junit.categories.OQLIndexTest;
@@ -96,11 +93,10 @@ public class CreateDefinedIndexesCommandDUnitTest {
         + " --expression=value1 --region=" + regionName + "1").statusIsSuccess()
         .containsOutput("Index successfully defined");
 
-    CommandResult result = gfsh.executeCommand("create defined indexes");
-    assertThat(result.getStatus()).isEqualTo(Result.Status.ERROR);
-    Map<String, List<String>> table =
-        result.getMapFromTableContent(CreateDefinedIndexesCommand.CREATE_DEFINED_INDEXES_SECTION);
-    assertThat(table.get("Status")).contains("ERROR", "ERROR", "ERROR");
+    gfsh.executeAndAssertThat("create defined indexes")
+        .statusIsError()
+        .hasTableSection(CreateDefinedIndexesCommand.CREATE_DEFINED_INDEXES_SECTION)
+        .hasColumn("Status").containsExactly("ERROR", "ERROR", "ERROR");
 
     VMProvider.invokeInEveryMember(() -> {
       Cache cache = ClusterStartupRule.getCache();
@@ -143,11 +139,10 @@ public class CreateDefinedIndexesCommandDUnitTest {
         "define index --name=" + index2Name + " --expression=value2 --region=" + region2Name)
         .statusIsSuccess().containsOutput("Index successfully defined");
 
-    CommandResult result = gfsh.executeCommand("create defined indexes");
-    assertThat(result.getStatus()).isEqualTo(Result.Status.OK);
-    Map<String, List<String>> table =
-        result.getMapFromTableContent(CreateDefinedIndexesCommand.CREATE_DEFINED_INDEXES_SECTION);
-    assertThat(table.get("Member").size()).isEqualTo(6);
+    gfsh.executeAndAssertThat("create defined indexes")
+        .statusIsSuccess()
+        .hasTableSection(CreateDefinedIndexesCommand.CREATE_DEFINED_INDEXES_SECTION)
+        .hasRowSize(6);
     assertThat(gfsh.getGfshOutput())
         .contains("Changes to configuration for group 'cluster' are persisted");
 
@@ -186,19 +181,18 @@ public class CreateDefinedIndexesCommandDUnitTest {
     String index1Name = "index_" + region1Name;
     String index2Name = "index_" + region2Name;
 
-    CommandResult result = gfsh
-        .executeCommand("create region --name=" + region1Name + " --type=REPLICATE --group=group1");
-    assertThat(result.getStatus()).isEqualTo(Result.Status.OK);
-    assertThat(result.getMapFromTableContent(MEMBER_STATUS_SECTION).get("Member")).contains(
-        "server-1",
-        "server-2");
+    gfsh.executeAndAssertThat(
+        "create region --name=" + region1Name + " --type=REPLICATE --group=group1")
+        .statusIsSuccess()
+        .hasTableSection(MEMBER_STATUS_SECTION)
+        .hasColumn("Member")
+        .containsExactly("server-1", "server-2");
 
-    result = gfsh
-        .executeCommand("create region --name=" + region2Name + " --type=REPLICATE --group=group1");
-    assertThat(result.getStatus()).isEqualTo(Result.Status.OK);
-    assertThat(result.getMapFromTableContent(MEMBER_STATUS_SECTION).get("Member")).contains(
-        "server-1",
-        "server-2");
+    gfsh.executeAndAssertThat(
+        "create region --name=" + region2Name + " --type=REPLICATE --group=group1")
+        .statusIsSuccess()
+        .hasTableSection(MEMBER_STATUS_SECTION).hasColumn("Member")
+        .containsExactly("server-1", "server-2");
 
     VMProvider.invokeInEveryMember(() -> {
       Cache cache = ClusterStartupRule.getCache();
@@ -251,18 +245,17 @@ public class CreateDefinedIndexesCommandDUnitTest {
     String index1Name = "index_" + region1Name;
     String index2Name = "index_" + region2Name;
 
-    CommandResult result = gfsh
-        .executeCommand("create region --name=" + region1Name + " --type=REPLICATE --group=group1");
-    assertThat(result.getStatus()).isEqualTo(Result.Status.OK);
-    assertThat(result.getMapFromTableContent(MEMBER_STATUS_SECTION).get("Member")).contains(
-        "server-1",
-        "server-2");
+    gfsh.executeAndAssertThat(
+        "create region --name=" + region1Name + " --type=REPLICATE --group=group1")
+        .statusIsSuccess()
+        .hasTableSection(MEMBER_STATUS_SECTION).hasColumn("Member")
+        .containsExactly("server-1", "server-2");
 
-    result = gfsh
-        .executeCommand("create region --name=" + region2Name + " --type=REPLICATE --group=group2");
-    assertThat(result.getStatus()).isEqualTo(Result.Status.OK);
-    assertThat(result.getMapFromTableContent(MEMBER_STATUS_SECTION).get("Member"))
-        .contains("server-3");
+    gfsh.executeAndAssertThat(
+        "create region --name=" + region2Name + " --type=REPLICATE --group=group2")
+        .statusIsSuccess()
+        .hasTableSection(MEMBER_STATUS_SECTION).hasColumn("Member")
+        .containsExactly("server-3");
 
     gfsh.executeAndAssertThat(
         "define index --name=" + index1Name + " --expression=value1 --region=" + region1Name)
@@ -272,11 +265,10 @@ public class CreateDefinedIndexesCommandDUnitTest {
         "define index --name=" + index2Name + " --expression=value1 --region=" + region2Name)
         .statusIsSuccess().containsOutput("Index successfully defined");
 
-    result = gfsh.executeCommand("create defined indexes --group=group1,group2");
-    assertThat(result.getStatus()).isEqualTo(Result.Status.ERROR);
-    assertThat(
-        result.getMapFromTableContent(CreateDefinedIndexesCommand.CREATE_DEFINED_INDEXES_SECTION)
-            .get("Status")).contains("ERROR", "ERROR", "ERROR");
+    gfsh.executeAndAssertThat("create defined indexes --group=group1,group2")
+        .statusIsError()
+        .hasTableSection(CreateDefinedIndexesCommand.CREATE_DEFINED_INDEXES_SECTION)
+        .hasColumn("Status").containsExactly("ERROR", "ERROR", "ERROR");
 
     VMProvider.invokeInEveryMember(() -> {
       Cache cache = ClusterStartupRule.getCache();
diff --git a/geode-core/src/distributedTest/java/org/apache/geode/management/internal/cli/commands/DescribeMembersCommandDUnitTest.java
b/geode-core/src/distributedTest/java/org/apache/geode/management/internal/cli/commands/DescribeMembersCommandDUnitTest.java
index da62f8c..f410964 100644
--- a/geode-core/src/distributedTest/java/org/apache/geode/management/internal/cli/commands/DescribeMembersCommandDUnitTest.java
+++ b/geode-core/src/distributedTest/java/org/apache/geode/management/internal/cli/commands/DescribeMembersCommandDUnitTest.java
@@ -68,7 +68,8 @@ public class DescribeMembersCommandDUnitTest {
         .statusIsSuccess()
         .getCommandResult();
 
-    Map<String, String> memberInfo = result.getMapFromSection("memberInfo");
+    Map<String, String> memberInfo =
+        result.getResultData().getDataSection("memberInfo").getContent();
     assertThat(memberInfo.get("Name")).isEqualTo("locator-0");
     assertThat(memberInfo.get("Id")).contains("locator-0");
     assertThat(memberInfo.get("Host")).as("Host").isNotBlank();
diff --git a/geode-core/src/distributedTest/java/org/apache/geode/management/internal/cli/commands/DiskStoreCommandsDUnitTest.java
b/geode-core/src/distributedTest/java/org/apache/geode/management/internal/cli/commands/DiskStoreCommandsDUnitTest.java
index 426b863..2f31f4a 100644
--- a/geode-core/src/distributedTest/java/org/apache/geode/management/internal/cli/commands/DiskStoreCommandsDUnitTest.java
+++ b/geode-core/src/distributedTest/java/org/apache/geode/management/internal/cli/commands/DiskStoreCommandsDUnitTest.java
@@ -51,11 +51,11 @@ import org.apache.geode.distributed.internal.InternalConfigurationPersistenceSer
 import org.apache.geode.distributed.internal.InternalLocator;
 import org.apache.geode.internal.cache.InternalCache;
 import org.apache.geode.internal.cache.SnapshotTestUtil;
-import org.apache.geode.management.cli.Result;
-import org.apache.geode.management.internal.cli.result.CommandResult;
+import org.apache.geode.management.internal.cli.result.model.TabularResultModel;
 import org.apache.geode.test.dunit.SerializableRunnableIF;
 import org.apache.geode.test.dunit.rules.ClusterStartupRule;
 import org.apache.geode.test.dunit.rules.MemberVM;
+import org.apache.geode.test.junit.assertions.CommandResultAssert;
 import org.apache.geode.test.junit.categories.PersistenceTest;
 import org.apache.geode.test.junit.rules.GfshCommandRule;
 import org.apache.geode.test.junit.rules.ServerStarterRule;
@@ -142,10 +142,12 @@ public class DiskStoreCommandsDUnitTest implements Serializable {
 
     locator.waitUntilDiskStoreIsReadyOnExactlyThisManyServers(DISKSTORE, 1);
 
-    gfsh.executeAndAssertThat("show missing-disk-stores").statusIsSuccess()
-        .containsOutput("Missing Disk Stores", "No missing colocated region found");
+    TabularResultModel table =
+        gfsh.executeAndAssertThat("show missing-disk-stores").statusIsSuccess()
+            .containsOutput("Missing Disk Stores", "No missing colocated region found")
+            .hasTableSection().getActual();
 
-    List<String> diskstoreIDs = gfsh.getCommandResult().getTableColumnValues("Disk
Store ID");
+    List<String> diskstoreIDs = table.getValuesInColumn("Disk Store ID");
     assertThat(diskstoreIDs.size()).isEqualTo(1);
 
     gfsh.executeAndAssertThat("revoke missing-disk-store --id=" + diskstoreIDs.get(0))
@@ -328,15 +330,12 @@ public class DiskStoreCommandsDUnitTest implements Serializable {
       }
     });
 
-    gfsh.executeAndAssertThat(
+    CommandResultAssert resultAssert = gfsh.executeAndAssertThat(
         String.format("compact disk-store --name=%s --group=%s", DISKSTORE, GROUP))
         .statusIsSuccess();
 
-    CommandResult cmdResult = gfsh.getCommandResult();
-    assertThat(cmdResult.getMapFromSection("server-1").keySet()).contains("UUID", "Host",
-        "Directory");
-    assertThat(cmdResult.getMapFromSection("server-2").keySet()).contains("UUID", "Host",
-        "Directory");
+    resultAssert.hasDataSection("server-1").hasContent().containsKeys("UUID", "Host", "Directory");
+    resultAssert.hasDataSection("server-2").hasContent().containsKeys("UUID", "Host", "Directory");
   }
 
   @Test
@@ -349,24 +348,21 @@ public class DiskStoreCommandsDUnitTest implements Serializable {
 
     server1.invoke(dataProducer());
 
-    CommandResult result = gfsh.executeCommand(
-        String.format("describe disk-store --member=%s --name=%s", server1.getName(), DISKSTORE));
-    assertThat(result.getStatus()).isEqualTo(Result.Status.OK);
-
-    Map<String, String> data =
-        result.getMapFromSection(DescribeDiskStoreCommand.DISK_STORE_SECTION);
-    assertThat(data.keySet()).contains("Disk Store Name", "Member ID", "Member Name",
-        "Allow Force Compaction", "Auto Compaction", "Compaction Threshold", "Max Oplog Size",
-        "Queue Size", "Time Interval", "Write Buffer Size", "Disk Usage Warning Percentage",
-        "Disk Usage Critical Percentage", "PDX Serialization Meta-Data Stored");
-
-    Map<String, List<String>> directories =
-        result.getMapFromTableContent(DescribeDiskStoreCommand.DISK_DIR_SECTION);
-    assertThat(directories.get("Disk Directory").size()).isEqualTo(1);
-
-    Map<String, List<String>> regions =
-        result.getMapFromTableContent(DescribeDiskStoreCommand.REGION_SECTION);
-    assertThat(regions.get("Region Path").size()).isEqualTo(1);
+    CommandResultAssert resultAssert = gfsh.executeAndAssertThat(
+        String.format("describe disk-store --member=%s --name=%s", server1.getName(), DISKSTORE))
+        .statusIsSuccess();
+    resultAssert.hasDataSection(DescribeDiskStoreCommand.DISK_STORE_SECTION)
+        .hasContent()
+        .containsKeys("Disk Store Name", "Member ID", "Member Name",
+            "Allow Force Compaction", "Auto Compaction", "Compaction Threshold", "Max Oplog
Size",
+            "Queue Size", "Time Interval", "Write Buffer Size", "Disk Usage Warning Percentage",
+            "Disk Usage Critical Percentage", "PDX Serialization Meta-Data Stored");
+
+    resultAssert.hasTableSection(DescribeDiskStoreCommand.DISK_DIR_SECTION)
+        .hasColumn("Disk Directory").hasSize(1);
+
+    resultAssert.hasTableSection(DescribeDiskStoreCommand.REGION_SECTION)
+        .hasColumn("Region Path").hasSize(1);
   }
 
   @Test
diff --git a/geode-core/src/distributedTest/java/org/apache/geode/management/internal/cli/commands/ListJndiBindingCommandDUnitTest.java
b/geode-core/src/distributedTest/java/org/apache/geode/management/internal/cli/commands/ListJndiBindingCommandDUnitTest.java
index b7b3f67..cbfac35 100644
--- a/geode-core/src/distributedTest/java/org/apache/geode/management/internal/cli/commands/ListJndiBindingCommandDUnitTest.java
+++ b/geode-core/src/distributedTest/java/org/apache/geode/management/internal/cli/commands/ListJndiBindingCommandDUnitTest.java
@@ -15,9 +15,6 @@
 
 package org.apache.geode.management.internal.cli.commands;
 
-import static org.assertj.core.api.Assertions.assertThat;
-
-import java.util.List;
 import java.util.Properties;
 
 import org.junit.BeforeClass;
@@ -58,21 +55,22 @@ public class ListJndiBindingCommandDUnitTest {
   public void listJndiBinding() {
     gfsh.executeAndAssertThat(
         "create jndi-binding --name=jndi1 --type=SIMPLE --jdbc-driver-class=org.apache.derby.jdbc.EmbeddedDriver
--connection-url=\"jdbc:derby:newDB;create=true\"")
-        .statusIsSuccess().tableHasColumnOnlyWithValues("Member", "server-1");
+        .statusIsSuccess()
+        .hasTableSection()
+        .hasColumn("Member").containsExactly("server-1");
 
     CommandResultAssert commandResultAssert =
         gfsh.executeAndAssertThat("list jndi-binding").statusIsSuccess();
-
-    // cluster configuration table
-    commandResultAssert.tableHasRowWithValues("Group Name", "JNDI Name", "JDBC Driver Class",
-        "cluster", "jndi1", "org.apache.derby.jdbc.EmbeddedDriver")
-        .tableHasRowCount(1);
+    commandResultAssert
+        .hasTableSection("clusterConfiguration")
+        .hasRowSize(1)
+        .hasRow(0)
+        .containsExactly("cluster", "jndi1", "org.apache.derby.jdbc.EmbeddedDriver");
 
     // member table
-    List<String> jndiNames = commandResultAssert.getCommandResult()
-        .getColumnFromTableContent("JNDI Name", "memberConfiguration");
-    assertThat(jndiNames.size()).isEqualTo(3);
-    assertThat(jndiNames).containsExactlyInAnyOrder("java:jndi1", "java:UserTransaction",
-        "java:TransactionManager");
+    commandResultAssert.hasTableSection("memberConfiguration")
+        .hasRowSize(3)
+        .hasColumn("JNDI Name").containsExactlyInAnyOrder("java:jndi1", "java:UserTransaction",
+            "java:TransactionManager");
   }
 }
diff --git a/geode-core/src/distributedTest/java/org/apache/geode/management/internal/cli/commands/ListMembersCommandDUnitTest.java
b/geode-core/src/distributedTest/java/org/apache/geode/management/internal/cli/commands/ListMembersCommandDUnitTest.java
index 2efdd06..33f75a5 100644
--- a/geode-core/src/distributedTest/java/org/apache/geode/management/internal/cli/commands/ListMembersCommandDUnitTest.java
+++ b/geode-core/src/distributedTest/java/org/apache/geode/management/internal/cli/commands/ListMembersCommandDUnitTest.java
@@ -19,8 +19,6 @@ import static org.apache.geode.management.internal.cli.i18n.CliStrings.LIST_MEMB
 import static org.apache.geode.test.junit.rules.GfshCommandRule.PortType.jmxManager;
 import static org.assertj.core.api.Assertions.assertThat;
 
-import java.util.List;
-import java.util.Map;
 import java.util.Properties;
 
 import org.junit.BeforeClass;
@@ -28,8 +26,6 @@ import org.junit.ClassRule;
 import org.junit.Rule;
 import org.junit.Test;
 
-import org.apache.geode.management.cli.Result;
-import org.apache.geode.management.internal.cli.result.CommandResult;
 import org.apache.geode.test.dunit.rules.ClusterStartupRule;
 import org.apache.geode.test.dunit.rules.MemberVM;
 import org.apache.geode.test.junit.rules.GfshCommandRule;
@@ -62,15 +58,9 @@ public class ListMembersCommandDUnitTest {
 
   @Test
   public void listAllMembers() throws Exception {
-    CommandResult result = gfsh.executeCommand(LIST_MEMBER);
-
-    assertThat(result.getStatus()).isEqualTo(Result.Status.OK);
-
-    Map<String, List<String>> table =
-        result.getMapFromTableContent(ListMembersCommand.MEMBERS_SECTION);
-
-    assertThat(table.get("Name").size()).isEqualTo(4);
-    assertThat(table.get("Name")).contains("locator-0", "server-1", "server-2", "server-3");
+    gfsh.executeAndAssertThat(LIST_MEMBER).statusIsSuccess()
+        .hasTableSection(ListMembersCommand.MEMBERS_SECTION).hasColumn("Name")
+        .containsExactlyInAnyOrder("locator-0", "server-1", "server-2", "server-3");
   }
 
   @Test
diff --git a/geode-core/src/distributedTest/java/org/apache/geode/management/internal/cli/commands/LocateEntryDUnitTest.java
b/geode-core/src/distributedTest/java/org/apache/geode/management/internal/cli/commands/LocateEntryDUnitTest.java
index 283e5f8..413284f 100644
--- a/geode-core/src/distributedTest/java/org/apache/geode/management/internal/cli/commands/LocateEntryDUnitTest.java
+++ b/geode-core/src/distributedTest/java/org/apache/geode/management/internal/cli/commands/LocateEntryDUnitTest.java
@@ -15,9 +15,7 @@
 
 package org.apache.geode.management.internal.cli.commands;
 
-import static org.assertj.core.api.Assertions.assertThat;
 
-import java.util.Map;
 import java.util.Properties;
 
 import org.junit.BeforeClass;
@@ -25,11 +23,9 @@ import org.junit.ClassRule;
 import org.junit.Test;
 
 import org.apache.geode.distributed.ConfigurationProperties;
-import org.apache.geode.management.cli.Result;
 import org.apache.geode.management.internal.cli.domain.DataCommandResult;
 import org.apache.geode.management.internal.cli.dto.Key;
 import org.apache.geode.management.internal.cli.dto.Value;
-import org.apache.geode.management.internal.cli.result.CommandResult;
 import org.apache.geode.test.dunit.rules.ClusterStartupRule;
 import org.apache.geode.test.dunit.rules.MemberVM;
 import org.apache.geode.test.junit.rules.GfshCommandRule;
@@ -79,30 +75,26 @@ public class LocateEntryDUnitTest {
 
   @Test
   public void locateEntryForPartitionedRegion() throws Exception {
-    CommandResult result = gfsh.executeCommand("locate entry --region=regionA --key=key");
-    assertThat(result.getStatus()).isEqualTo(Result.Status.OK);
-
-    Map<String, String> data = result.getMapFromSection(DataCommandResult.DATA_INFO_SECTION);
-    assertThat(data.get("Locations Found")).isEqualTo("1");
+    gfsh.executeAndAssertThat("locate entry --region=regionA --key=key")
+        .statusIsSuccess()
+        .hasDataSection(DataCommandResult.DATA_INFO_SECTION).hasContent()
+        .containsEntry("Locations Found", "1");
   }
 
   @Test
   public void locateEntryForReplicateRegion() throws Exception {
-    CommandResult result = gfsh.executeCommand("locate entry --region=regionB --key=key");
-    assertThat(result.getStatus()).isEqualTo(Result.Status.OK);
-
-    Map<String, String> data = result.getMapFromSection(DataCommandResult.DATA_INFO_SECTION);
-    assertThat(data.get("Locations Found")).isEqualTo("2");
+    gfsh.executeAndAssertThat("locate entry --region=regionB --key=key")
+        .statusIsSuccess()
+        .hasDataSection(DataCommandResult.DATA_INFO_SECTION).hasContent()
+        .containsEntry("Locations Found", "2");
   }
 
   @Test
   public void recursiveLocate() throws Exception {
-    CommandResult result =
-        gfsh.executeCommand("locate entry --region=regionB --key=key --recursive=true");
-    assertThat(result.getStatus()).isEqualTo(Result.Status.OK);
-
-    Map<String, String> data = result.getMapFromSection(DataCommandResult.DATA_INFO_SECTION);
-    assertThat(data.get("Locations Found")).isEqualTo("4");
+    gfsh.executeAndAssertThat("locate entry --region=regionB --key=key --recursive=true")
+        .statusIsSuccess()
+        .hasDataSection(DataCommandResult.DATA_INFO_SECTION).hasContent()
+        .containsEntry("Locations Found", "4");
   }
 
   @Test
@@ -111,12 +103,10 @@ public class LocateEntryDUnitTest {
         "put --region=regionA --key=('key':'1') --value=('value':'1') " + "--key-class="
             + Key.class.getCanonicalName() + " --value-class=" + Value.class.getCanonicalName())
         .statusIsSuccess();
-    CommandResult result =
-        gfsh.executeCommand("locate entry --region=regionA --key=('key':'1') " + "--key-class="
-            + Key.class.getCanonicalName() + " --value-class=" + Value.class.getCanonicalName());
-    assertThat(result.getStatus()).isEqualTo(Result.Status.OK);
-
-    Map<String, String> data = result.getMapFromSection(DataCommandResult.DATA_INFO_SECTION);
-    assertThat(data.get("Locations Found")).isEqualTo("1");
+    gfsh.executeAndAssertThat("locate entry --region=regionA --key=('key':'1') " + "--key-class="
+        + Key.class.getCanonicalName() + " --value-class=" + Value.class.getCanonicalName())
+        .statusIsSuccess()
+        .hasDataSection(DataCommandResult.DATA_INFO_SECTION).hasContent()
+        .containsEntry("Locations Found", "1");
   }
 }
diff --git a/geode-core/src/integrationTest/java/org/apache/geode/management/internal/cli/commands/GetCommandIntegrationTest.java
b/geode-core/src/integrationTest/java/org/apache/geode/management/internal/cli/commands/GetCommandIntegrationTest.java
index 13ada24..409f9b8 100644
--- a/geode-core/src/integrationTest/java/org/apache/geode/management/internal/cli/commands/GetCommandIntegrationTest.java
+++ b/geode-core/src/integrationTest/java/org/apache/geode/management/internal/cli/commands/GetCommandIntegrationTest.java
@@ -15,7 +15,6 @@
 
 package org.apache.geode.management.internal.cli.commands;
 
-import static org.assertj.core.api.Assertions.assertThat;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertFalse;
 
@@ -36,9 +35,7 @@ import org.apache.geode.cache.Region;
 import org.apache.geode.cache.RegionFactory;
 import org.apache.geode.cache.RegionShortcut;
 import org.apache.geode.internal.cache.InternalCache;
-import org.apache.geode.management.cli.Result;
 import org.apache.geode.management.internal.cli.domain.DataCommandResult;
-import org.apache.geode.management.internal.cli.result.CommandResult;
 import org.apache.geode.pdx.PdxInstance;
 import org.apache.geode.pdx.PdxInstanceFactory;
 import org.apache.geode.pdx.internal.PdxInstanceFactoryImpl;
@@ -112,99 +109,96 @@ public class GetCommandIntegrationTest {
 
   @Test
   public void getOnCacheMissForRegularRegion() throws Exception {
-    CommandResult result = gfsh.executeCommand("get --region=Users --key=jonbloom");
-    assertThat(result.getStatus()).isEqualTo(Result.Status.OK);
-
-    Map<String, String> data = result.getMapFromSection(DataCommandResult.DATA_INFO_SECTION);
-    assertThat(data.get("Result")).isEqualTo("true");
-
-    result = gfsh.executeCommand("get --region=Users --key=jondoe --load-on-cache-miss=false");
-    assertThat(result.getStatus()).isEqualTo(Result.Status.OK);
-
-    data = result.getMapFromSection(DataCommandResult.DATA_INFO_SECTION);
-    assertThat(data.get("Result")).isEqualTo("false");
-    assertThat(data.get("Message")).isEqualTo("Key is not present in the region");
-
-    result = gfsh.executeCommand("get --region=Users --key=jondoe");
-    assertThat(result.getStatus()).isEqualTo(Result.Status.OK);
-
-    data = result.getMapFromSection(DataCommandResult.DATA_INFO_SECTION);
-    assertThat(data.get("Result")).isEqualTo("true");
-    assertThat(data.get("Value Class")).isEqualTo(User.class.getCanonicalName());
+    gfsh.executeAndAssertThat("get --region=Users --key=jonbloom")
+        .statusIsSuccess()
+        .hasDataSection(DataCommandResult.DATA_INFO_SECTION)
+        .hasContent()
+        .containsEntry("Result", "true");
+
+    gfsh.executeAndAssertThat("get --region=Users --key=jondoe --load-on-cache-miss=false")
+        .statusIsSuccess()
+        .hasDataSection(DataCommandResult.DATA_INFO_SECTION)
+        .hasContent()
+        .containsEntry("Result", "false")
+        .containsEntry("Message", "Key is not present in the region");
+
+    gfsh.executeAndAssertThat("get --region=Users --key=jondoe")
+        .statusIsSuccess()
+        .hasDataSection(DataCommandResult.DATA_INFO_SECTION).hasContent()
+        .containsEntry("Result", "true")
+        .containsEntry("Value Class", User.class.getCanonicalName());
 
     // get something that does not exist
-    result = gfsh.executeCommand("get --region=Users --key=missingUser --load-on-cache-miss");
-    assertThat(result.getStatus()).isEqualTo(Result.Status.OK);
-
-    data = result.getMapFromSection(DataCommandResult.DATA_INFO_SECTION);
-    assertThat(data.get("Result")).isEqualTo("false");
-    assertThat(data.get("Value")).isEqualTo("null");
+    gfsh.executeAndAssertThat("get --region=Users --key=missingUser --load-on-cache-miss")
+        .statusIsSuccess()
+        .hasDataSection(DataCommandResult.DATA_INFO_SECTION).hasContent()
+        .containsEntry("Result", "false")
+        .containsEntry("Value", "null");
   }
 
   @Test
   public void getOnCacheMissForPdxRegion() {
-    CommandResult result = gfsh.executeCommand("get --region=UsersPdx --key=jonbloom");
-    assertThat(result.getStatus()).isEqualTo(Result.Status.OK);
-
-    Map<String, String> data = result.getMapFromSection(DataCommandResult.DATA_INFO_SECTION);
-    assertThat(data.get("Result")).isEqualTo("true");
-
-    result = gfsh.executeCommand("get --region=UsersPdx --key=jondoe --load-on-cache-miss=false");
-    assertThat(result.getStatus()).isEqualTo(Result.Status.OK);
-
-    data = result.getMapFromSection(DataCommandResult.DATA_INFO_SECTION);
-    assertThat(data.get("Result")).isEqualTo("false");
-    assertThat(data.get("Message")).isEqualTo("Key is not present in the region");
-
-    result = gfsh.executeCommand("get --region=UsersPdx --key=jondoe");
-    assertThat(result.getStatus()).isEqualTo(Result.Status.OK);
-
-    data = result.getMapFromSection(DataCommandResult.DATA_INFO_SECTION);
-    assertThat(data.get("Result")).isEqualTo("true");
-    assertThat(data.get("Value Class")).isEqualTo(PdxInstanceImpl.class.getCanonicalName());
+    gfsh.executeAndAssertThat("get --region=UsersPdx --key=jonbloom")
+        .statusIsSuccess()
+        .hasDataSection(DataCommandResult.DATA_INFO_SECTION)
+        .hasContent()
+        .containsEntry("Result", "true");
+
+    gfsh.executeAndAssertThat("get --region=UsersPdx --key=jondoe --load-on-cache-miss=false")
+        .statusIsSuccess()
+        .hasDataSection(DataCommandResult.DATA_INFO_SECTION)
+        .hasContent()
+        .containsEntry("Result", "false")
+        .containsEntry("Message", "Key is not present in the region");
+
+    gfsh.executeAndAssertThat("get --region=UsersPdx --key=jondoe")
+        .statusIsSuccess()
+        .hasDataSection(DataCommandResult.DATA_INFO_SECTION)
+        .hasContent()
+        .containsEntry("Result", "true")
+        .containsEntry("Value Class", PdxInstanceImpl.class.getCanonicalName());
 
     // get something that does not exist
-    result = gfsh.executeCommand("get --region=UsersPdx --key=missingUser --load-on-cache-miss");
-    assertThat(result.getStatus()).isEqualTo(Result.Status.OK);
-
-    data = result.getMapFromSection(DataCommandResult.DATA_INFO_SECTION);
-    assertThat(data.get("Result")).isEqualTo("false");
-    assertThat(data.get("Value")).isEqualTo("null");
+    gfsh.executeAndAssertThat("get --region=UsersPdx --key=missingUser --load-on-cache-miss")
+        .statusIsSuccess()
+        .hasDataSection(DataCommandResult.DATA_INFO_SECTION)
+        .hasContent()
+        .containsEntry("Result", "false")
+        .containsEntry("Value", "null");
   }
 
   @Test
   public void getOnCacheMissForStringRegion() throws Exception {
-    CommandResult result = gfsh.executeCommand("get --region=UsersString --key=jonbloom");
-    assertThat(result.getStatus()).isEqualTo(Result.Status.OK);
-
-    Map<String, String> data = result.getMapFromSection(DataCommandResult.DATA_INFO_SECTION);
-    assertThat(data.get("Result")).isEqualTo("true");
-    assertThat(data.get("Value")).isEqualTo("\"6a6f6e626c6f6f6d\"");
-
-    result =
-        gfsh.executeCommand("get --region=UsersString --key=jondoe --load-on-cache-miss=false");
-    assertThat(result.getStatus()).isEqualTo(Result.Status.OK);
-
-    data = result.getMapFromSection(DataCommandResult.DATA_INFO_SECTION);
-    assertThat(data.get("Result")).isEqualTo("false");
-    assertThat(data.get("Message")).isEqualTo("Key is not present in the region");
-    assertThat(data.get("Value")).isEqualTo("null");
-
-    result = gfsh.executeCommand("get --region=UsersString --key=jondoe");
-    assertThat(result.getStatus()).isEqualTo(Result.Status.OK);
-
-    data = result.getMapFromSection(DataCommandResult.DATA_INFO_SECTION);
-    assertThat(data.get("Result")).isEqualTo("true");
-    assertThat(data.get("Value Class")).isEqualTo(String.class.getName());
-    assertThat(data.get("Value")).isEqualTo("\"6a6f6e646f65\"");
+    gfsh.executeAndAssertThat("get --region=UsersString --key=jonbloom")
+        .statusIsSuccess()
+        .hasDataSection(DataCommandResult.DATA_INFO_SECTION)
+        .hasContent()
+        .containsEntry("Result", "true")
+        .containsEntry("Value", "\"6a6f6e626c6f6f6d\"");
+
+    gfsh.executeAndAssertThat("get --region=UsersString --key=jondoe --load-on-cache-miss=false")
+        .statusIsSuccess()
+        .hasDataSection(DataCommandResult.DATA_INFO_SECTION)
+        .hasContent()
+        .containsEntry("Result", "false")
+        .containsEntry("Message", "Key is not present in the region")
+        .containsEntry("Value", "null");
+
+    gfsh.executeAndAssertThat("get --region=UsersString --key=jondoe")
+        .statusIsSuccess()
+        .hasDataSection(DataCommandResult.DATA_INFO_SECTION)
+        .hasContent()
+        .containsEntry("Result", "true")
+        .containsEntry("Value Class", String.class.getName())
+        .containsEntry("Value", "\"6a6f6e646f65\"");
 
     // get something that does not exist
-    result = gfsh.executeCommand("get --region=UsersString --key=missingUser --load-on-cache-miss");
-    assertThat(result.getStatus()).isEqualTo(Result.Status.OK);
-
-    data = result.getMapFromSection(DataCommandResult.DATA_INFO_SECTION);
-    assertThat(data.get("Result")).isEqualTo("false");
-    assertThat(data.get("Value")).isEqualTo("null");
+    gfsh.executeAndAssertThat("get --region=UsersString --key=missingUser --load-on-cache-miss")
+        .statusIsSuccess()
+        .hasDataSection(DataCommandResult.DATA_INFO_SECTION)
+        .hasContent()
+        .containsEntry("Result", "false")
+        .containsEntry("Value", "null");
   }
 
   private static class User implements Serializable {
diff --git a/geode-core/src/integrationTest/java/org/apache/geode/management/internal/cli/commands/PutCommandIntegrationTest.java
b/geode-core/src/integrationTest/java/org/apache/geode/management/internal/cli/commands/PutCommandIntegrationTest.java
index 28dd102..70a5f66 100644
--- a/geode-core/src/integrationTest/java/org/apache/geode/management/internal/cli/commands/PutCommandIntegrationTest.java
+++ b/geode-core/src/integrationTest/java/org/apache/geode/management/internal/cli/commands/PutCommandIntegrationTest.java
@@ -17,8 +17,6 @@ package org.apache.geode.management.internal.cli.commands;
 
 import static org.assertj.core.api.Assertions.assertThat;
 
-import java.util.Map;
-
 import org.junit.After;
 import org.junit.ClassRule;
 import org.junit.Test;
@@ -26,7 +24,6 @@ import org.junit.experimental.categories.Category;
 import org.junit.rules.RuleChain;
 
 import org.apache.geode.cache.RegionShortcut;
-import org.apache.geode.management.cli.Result;
 import org.apache.geode.management.internal.cli.domain.DataCommandResult;
 import org.apache.geode.management.internal.cli.dto.Car;
 import org.apache.geode.management.internal.cli.dto.Key;
@@ -34,7 +31,6 @@ import org.apache.geode.management.internal.cli.dto.Key1;
 import org.apache.geode.management.internal.cli.dto.ObjectWithCharAttr;
 import org.apache.geode.management.internal.cli.dto.Value;
 import org.apache.geode.management.internal.cli.dto.Value2;
-import org.apache.geode.management.internal.cli.result.CommandResult;
 import org.apache.geode.test.junit.categories.GfshTest;
 import org.apache.geode.test.junit.rules.GfshCommandRule;
 import org.apache.geode.test.junit.rules.ServerStarterRule;
@@ -112,11 +108,10 @@ public class PutCommandIntegrationTest {
     gfsh.executeAndAssertThat("help put").statusIsSuccess()
         .containsOutput("(Deprecated: Use --if-not-exists).");
 
-    CommandResult result =
-        gfsh.executeCommand("put --region=/testRegion --key=key1 --value=value1");
-    assertThat(result.getStatus()).isEqualTo(Result.Status.OK);
-    Map<String, String> data = result.getMapFromSection(DataCommandResult.DATA_INFO_SECTION);
-    assertThat(data.get("Result")).isEqualTo("true");
+    gfsh.executeAndAssertThat("put --region=/testRegion --key=key1 --value=value1")
+        .statusIsSuccess()
+        .hasDataSection(DataCommandResult.DATA_INFO_SECTION).hasContent()
+        .containsEntry("Result", "true");
 
     // if unspecified then override
     gfsh.executeAndAssertThat("put --region=/testRegion --key=key1 --value=value2")
@@ -137,22 +132,22 @@ public class PutCommandIntegrationTest {
 
   @Test
   public void putWithSimpleJson() throws Exception {
-    CommandResult result = gfsh.executeCommand(
+    gfsh.executeAndAssertThat(
         "put --region=testRegion --key=('key':'1') --value=('value':'1') " + "--key-class="
-            + Key.class.getCanonicalName() + " --value-class=" + Value.class.getCanonicalName());
-    assertThat(result.getStatus()).isEqualTo(Result.Status.OK);
-    Map<String, String> data = result.getMapFromSection(DataCommandResult.DATA_INFO_SECTION);
-    assertThat(data.get("Result")).isEqualTo("true");
+            + Key.class.getCanonicalName() + " --value-class=" + Value.class.getCanonicalName())
+        .statusIsSuccess()
+        .hasDataSection(DataCommandResult.DATA_INFO_SECTION).hasContent()
+        .containsEntry("Result", "true");
   }
 
   @Test
   public void putWithCorrectJsonSyntax() throws Exception {
-    CommandResult result = gfsh.executeCommand(
+    gfsh.executeAndAssertThat(
         "put --region=testRegion --key={\"key\":\"1\"} --value={\"value\":\"1\"} " + "--key-class="
-            + Key.class.getCanonicalName() + " --value-class=" + Value.class.getCanonicalName());
-    assertThat(result.getStatus()).isEqualTo(Result.Status.OK);
-    Map<String, String> data = result.getMapFromSection(DataCommandResult.DATA_INFO_SECTION);
-    assertThat(data.get("Result")).isEqualTo("true");
+            + Key.class.getCanonicalName() + " --value-class=" + Value.class.getCanonicalName())
+        .statusIsSuccess()
+        .hasDataSection(DataCommandResult.DATA_INFO_SECTION).hasContent()
+        .containsEntry("Result", "true");
   }
 
   @Test
@@ -175,11 +170,10 @@ public class PutCommandIntegrationTest {
     String command =
         "put --region=testRegion --key=" + keyJson + " --value=" + stateJson + " --key-class="
             + Key1.class.getCanonicalName() + " --value-class=" + Value2.class.getCanonicalName();
-    CommandResult result = gfsh.executeCommand(command);
-    assertThat(result.getStatus()).isEqualTo(Result.Status.OK);
-
-    Map<String, String> data = result.getMapFromSection(DataCommandResult.DATA_INFO_SECTION);
-    assertThat(data.get("Result")).isEqualTo("true");
+    gfsh.executeAndAssertThat(command)
+        .statusIsSuccess()
+        .hasDataSection(DataCommandResult.DATA_INFO_SECTION).hasContent()
+        .containsEntry("Result", "true");
 
     // put the car json
     String list = "['red','white','blue']";
@@ -190,19 +184,17 @@ public class PutCommandIntegrationTest {
     valueJson = valueJson.replaceAll("\\?map", map);
     command = "put --region=testRegion --key=" + keyJson + " --value=" + valueJson + " --key-class="
         + Key1.class.getCanonicalName() + " --value-class=" + Car.class.getCanonicalName();
-    result = gfsh.executeCommand(command);
-    assertThat(result.getStatus()).isEqualTo(Result.Status.OK);
-
-    data = result.getMapFromSection(DataCommandResult.DATA_INFO_SECTION);
-    assertThat(data.get("Result")).isEqualTo("true");
+    gfsh.executeAndAssertThat(command)
+        .statusIsSuccess()
+        .hasDataSection(DataCommandResult.DATA_INFO_SECTION).hasContent()
+        .containsEntry("Result", "true");
 
     // put with json with single character field
     command = "put --region=testRegion --key-class=" + ObjectWithCharAttr.class.getCanonicalName()
         + " --value=456 --key=('name':'hesdfdsfy2','t':456,'c':'d')";
-    result = gfsh.executeCommand(command);
-    assertThat(result.getStatus()).isEqualTo(Result.Status.OK);
-
-    data = result.getMapFromSection(DataCommandResult.DATA_INFO_SECTION);
-    assertThat(data.get("Result")).isEqualTo("true");
+    gfsh.executeAndAssertThat(command)
+        .statusIsSuccess()
+        .hasDataSection(DataCommandResult.DATA_INFO_SECTION).hasContent()
+        .containsEntry("Result", "true");
   }
 }
diff --git a/geode-core/src/main/java/org/apache/geode/management/internal/cli/remote/CommandExecutor.java
b/geode-core/src/main/java/org/apache/geode/management/internal/cli/remote/CommandExecutor.java
index e5b84af..02e15dd 100755
--- a/geode-core/src/main/java/org/apache/geode/management/internal/cli/remote/CommandExecutor.java
+++ b/geode-core/src/main/java/org/apache/geode/management/internal/cli/remote/CommandExecutor.java
@@ -34,6 +34,7 @@ import org.apache.geode.management.cli.SingleGfshCommand;
 import org.apache.geode.management.cli.UpdateAllConfigurationGroupsMarker;
 import org.apache.geode.management.internal.cli.GfshParseResult;
 import org.apache.geode.management.internal.cli.exceptions.UserErrorException;
+import org.apache.geode.management.internal.cli.result.CommandResult;
 import org.apache.geode.management.internal.cli.result.model.InfoResultModel;
 import org.apache.geode.management.internal.cli.result.model.ResultModel;
 import org.apache.geode.management.internal.cli.result.model.TabularResultModel;
@@ -77,7 +78,11 @@ public class CommandExecutor {
     try {
       Object result = invokeCommand(command, parseResult);
 
-      if (result instanceof Result) {
+      // if some custom command returns Result instead of ResultModel, we need to turn that
+      // into ResultModel in order to be processed later on.
+      if (result instanceof CommandResult) {
+        result = ((CommandResult) result).getResultData();
+      } else if (result instanceof Result) {
         Result customResult = (Result) result;
         result = new ResultModel();
         InfoResultModel info = ((ResultModel) result).addInfo();
diff --git a/geode-core/src/main/java/org/apache/geode/management/internal/cli/result/CommandResult.java
b/geode-core/src/main/java/org/apache/geode/management/internal/cli/result/CommandResult.java
index 0fc1c70..38c22e4 100644
--- a/geode-core/src/main/java/org/apache/geode/management/internal/cli/result/CommandResult.java
+++ b/geode-core/src/main/java/org/apache/geode/management/internal/cli/result/CommandResult.java
@@ -24,7 +24,6 @@ import java.util.List;
 import java.util.Map;
 
 import org.apache.geode.annotations.Immutable;
-import org.apache.geode.annotations.VisibleForTesting;
 import org.apache.geode.management.cli.Result;
 import org.apache.geode.management.internal.cli.GfshParser;
 import org.apache.geode.management.internal.cli.result.model.AbstractResultModel;
@@ -109,45 +108,6 @@ public class CommandResult implements Result {
     commandOutput.addAll(resultTable.buildTableList());
   }
 
-  @VisibleForTesting
-  public Map<String, String> getMapFromSection(String sectionID) {
-    return result.getDataSection(sectionID).getContent();
-  }
-
-  @VisibleForTesting
-  public List<String> getTableColumnValues(String columnName) {
-    List<TabularResultModel> tables = result.getTableSections();
-    if (tables.size() == 0) {
-      return EMPTY_LIST;
-    }
-
-    return tables.get(0).getContent().get(columnName);
-  }
-
-  @VisibleForTesting
-  public Map<String, List<String>> getMapFromTableContent(String tableId) {
-    TabularResultModel table = result.getTableSection(tableId);
-    if (table == null) {
-      return EMPTY_TABLE_MAP;
-    }
-
-    return table.getContent();
-  }
-
-  @VisibleForTesting
-  public List<String> getColumnFromTableContent(String column, String tableId) {
-    TabularResultModel table = result.getTableSection(tableId);
-    if (table == null) {
-      return EMPTY_LIST;
-    }
-
-    return table.getContent().get(column);
-  }
-
-  @VisibleForTesting
-  public List<String> getCommandOutput() {
-    return commandOutput;
-  }
 
   private void addSpacedRowInTable(TableBuilder.Table resultTable, String row) {
     if (row != null && !row.isEmpty()) {
@@ -209,7 +169,6 @@ public class CommandResult implements Result {
     for (Map.Entry<String, String> entry : section.getContent().entrySet()) {
       TableBuilder.Row newRow = rowGroup.newRow();
       String key = entry.getKey();
-      String value = entry.getValue();
       String[] values = entry.getValue().split(GfshParser.LINE_SEPARATOR);
       if (values.length == 1) {
         newRow.newLeftCol(key).newLeftCol(values[0]);
diff --git a/geode-core/src/test/java/org/apache/geode/management/internal/cli/commands/CreateDefinedIndexesCommandTest.java
b/geode-core/src/test/java/org/apache/geode/management/internal/cli/commands/CreateDefinedIndexesCommandTest.java
index 69bd50d..d703735 100644
--- a/geode-core/src/test/java/org/apache/geode/management/internal/cli/commands/CreateDefinedIndexesCommandTest.java
+++ b/geode-core/src/test/java/org/apache/geode/management/internal/cli/commands/CreateDefinedIndexesCommandTest.java
@@ -15,7 +15,6 @@
 
 package org.apache.geode.management.internal.cli.commands;
 
-import static org.assertj.core.api.Assertions.assertThat;
 import static org.mockito.ArgumentMatchers.any;
 import static org.mockito.Mockito.doReturn;
 import static org.mockito.Mockito.mock;
@@ -28,7 +27,6 @@ import java.util.Arrays;
 import java.util.Collections;
 import java.util.HashSet;
 import java.util.List;
-import java.util.Map;
 import java.util.Set;
 
 import org.junit.Before;
@@ -41,7 +39,6 @@ import org.apache.geode.cache.query.IndexType;
 import org.apache.geode.distributed.DistributedMember;
 import org.apache.geode.distributed.internal.InternalConfigurationPersistenceService;
 import org.apache.geode.management.internal.cli.functions.CliFunctionResult;
-import org.apache.geode.management.internal.cli.result.CommandResult;
 import org.apache.geode.test.junit.rules.GfshParserRule;
 
 public class CreateDefinedIndexesCommandTest {
@@ -133,12 +130,9 @@ public class CreateDefinedIndexesCommandTest {
     IndexDefinition.addIndex("index1", "value1", "TestRegion1", IndexType.FUNCTIONAL);
     IndexDefinition.addIndex("index2", "value2", "TestRegion2", IndexType.FUNCTIONAL);
 
-    CommandResult result =
-        gfshParser.executeAndAssertThat(command, "create defined indexes").statusIsSuccess()
-            .getCommandResult();
-
-    Map<String, List<String>> table =
-        result.getMapFromTableContent(CreateDefinedIndexesCommand.CREATE_DEFINED_INDEXES_SECTION);
-    assertThat(table.get("Status")).contains("OK", "OK", "OK", "OK");
+    gfshParser.executeAndAssertThat(command, "create defined indexes").statusIsSuccess()
+        .hasTableSection()
+        .hasColumn("Status")
+        .containsExactly("OK", "OK");
   }
 }


Mime
View raw message