Search in sources :

Example 1 with RegionPathConverter

use of org.apache.geode.management.internal.cli.converters.RegionPathConverter in project geode by apache.

the class GfshParserConverterTest method testRegionPathConverter.

@Test
public void testRegionPathConverter() throws Exception {
    RegionPathConverter spy = spyConverter(RegionPathConverter.class);
    Set<String> regions = Arrays.stream("/regionA,/regionB".split(",")).collect(Collectors.toSet());
    doReturn(regions).when(spy).getAllRegionPaths();
    String command = "describe region --name=";
    cursor = parser.completeAdvanced(command, candidates);
    assertThat(candidates).hasSize(regions.size());
    assertThat(getCompleted(command, cursor, candidates.get(0))).isEqualTo(command + "/regionA");
}
Also used : RegionPathConverter(org.apache.geode.management.internal.cli.converters.RegionPathConverter) Test(org.junit.Test) IntegrationTest(org.apache.geode.test.junit.categories.IntegrationTest)

Aggregations

RegionPathConverter (org.apache.geode.management.internal.cli.converters.RegionPathConverter)1 IntegrationTest (org.apache.geode.test.junit.categories.IntegrationTest)1 Test (org.junit.Test)1