geode-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jche...@apache.org
Subject [geode] branch feature/GEODE-6273 updated: Fixed failures in CreateMappingCommandTest
Date Tue, 29 Jan 2019 17:57:40 GMT
This is an automated email from the ASF dual-hosted git repository.

jchen21 pushed a commit to branch feature/GEODE-6273
in repository https://gitbox.apache.org/repos/asf/geode.git


The following commit(s) were added to refs/heads/feature/GEODE-6273 by this push:
     new 950f4a5  Fixed failures in CreateMappingCommandTest
950f4a5 is described below

commit 950f4a51a5f8fc060d7209abd9eee94b542e2f9c
Author: Jianxia Chen <jchen@pivotal.io>
AuthorDate: Tue Jan 29 09:56:00 2019 -0800

    Fixed failures in CreateMappingCommandTest
    
    - Replaced hardcoded default group name "cluster"
    
    Co-authored-by: Jianxia Chen <jchen@pivotal.io>
    Co-authored-by: Ben Ross <bross@pivotal.io>
---
 .../jdbc/internal/cli/CreateMappingCommand.java     |  2 +-
 .../jdbc/internal/cli/CreateMappingCommandTest.java | 21 ++++++++++++++-------
 2 files changed, 15 insertions(+), 8 deletions(-)

diff --git a/geode-connectors/src/main/java/org/apache/geode/connectors/jdbc/internal/cli/CreateMappingCommand.java
b/geode-connectors/src/main/java/org/apache/geode/connectors/jdbc/internal/cli/CreateMappingCommand.java
index ecc4b40..e6e1f8c 100644
--- a/geode-connectors/src/main/java/org/apache/geode/connectors/jdbc/internal/cli/CreateMappingCommand.java
+++ b/geode-connectors/src/main/java/org/apache/geode/connectors/jdbc/internal/cli/CreateMappingCommand.java
@@ -120,7 +120,7 @@ public class CreateMappingCommand extends SingleGfshCommand {
       ConfigurationPersistenceService configurationPersistenceService =
           checkForClusterConfiguration();
       if (groups == null) {
-        groups = new String[] {"cluster"};
+        groups = new String[] {ConfigurationPersistenceService.CLUSTER_CONFIG};
       }
       for (String group : groups) {
         CacheConfig cacheConfig = configurationPersistenceService.getCacheConfig(group);
diff --git a/geode-connectors/src/test/java/org/apache/geode/connectors/jdbc/internal/cli/CreateMappingCommandTest.java
b/geode-connectors/src/test/java/org/apache/geode/connectors/jdbc/internal/cli/CreateMappingCommandTest.java
index 5bd85b2..d765a8e 100644
--- a/geode-connectors/src/test/java/org/apache/geode/connectors/jdbc/internal/cli/CreateMappingCommandTest.java
+++ b/geode-connectors/src/test/java/org/apache/geode/connectors/jdbc/internal/cli/CreateMappingCommandTest.java
@@ -113,7 +113,8 @@ public class CreateMappingCommandTest {
         mock(ConfigurationPersistenceService.class);
     doReturn(configurationPersistenceService).when(createRegionMappingCommand)
         .getConfigurationPersistenceService();
-    when(configurationPersistenceService.getCacheConfig(null)).thenReturn(cacheConfig);
+    when(configurationPersistenceService
+        .getCacheConfig(ConfigurationPersistenceService.CLUSTER_CONFIG)).thenReturn(cacheConfig);
     List<RegionConfig> list = new ArrayList<>();
     list.add(matchingRegion);
     when(cacheConfig.getRegions()).thenReturn(list);
@@ -229,7 +230,8 @@ public class CreateMappingCommandTest {
         mock(ConfigurationPersistenceService.class);
     doReturn(configurationPersistenceService).when(createRegionMappingCommand)
         .getConfigurationPersistenceService();
-    when(configurationPersistenceService.getCacheConfig(null)).thenReturn(cacheConfig);
+    when(configurationPersistenceService
+        .getCacheConfig(ConfigurationPersistenceService.CLUSTER_CONFIG)).thenReturn(cacheConfig);
     when(cacheConfig.getRegions()).thenReturn(Collections.emptyList());
 
     ResultModel result = createRegionMappingCommand.createMapping(regionName, dataSourceName,
@@ -247,7 +249,8 @@ public class CreateMappingCommandTest {
         mock(ConfigurationPersistenceService.class);
     doReturn(configurationPersistenceService).when(createRegionMappingCommand)
         .getConfigurationPersistenceService();
-    when(configurationPersistenceService.getCacheConfig(null)).thenReturn(cacheConfig);
+    when(configurationPersistenceService
+        .getCacheConfig(ConfigurationPersistenceService.CLUSTER_CONFIG)).thenReturn(cacheConfig);
     List<RegionConfig> list = new ArrayList<>();
     list.add(matchingRegion);
     when(cacheConfig.getRegions()).thenReturn(list);
@@ -275,7 +278,8 @@ public class CreateMappingCommandTest {
         mock(ConfigurationPersistenceService.class);
     doReturn(configurationPersistenceService).when(createRegionMappingCommand)
         .getConfigurationPersistenceService();
-    when(configurationPersistenceService.getCacheConfig(null)).thenReturn(cacheConfig);
+    when(configurationPersistenceService
+        .getCacheConfig(ConfigurationPersistenceService.CLUSTER_CONFIG)).thenReturn(cacheConfig);
     List<RegionConfig> list = new ArrayList<>();
     list.add(matchingRegion);
     when(cacheConfig.getRegions()).thenReturn(list);
@@ -300,7 +304,8 @@ public class CreateMappingCommandTest {
         mock(ConfigurationPersistenceService.class);
     doReturn(configurationPersistenceService).when(createRegionMappingCommand)
         .getConfigurationPersistenceService();
-    when(configurationPersistenceService.getCacheConfig(null)).thenReturn(cacheConfig);
+    when(configurationPersistenceService
+        .getCacheConfig(ConfigurationPersistenceService.CLUSTER_CONFIG)).thenReturn(cacheConfig);
     List<RegionConfig> list = new ArrayList<>();
     list.add(matchingRegion);
     when(cacheConfig.getRegions()).thenReturn(list);
@@ -325,7 +330,8 @@ public class CreateMappingCommandTest {
         mock(ConfigurationPersistenceService.class);
     doReturn(configurationPersistenceService).when(createRegionMappingCommand)
         .getConfigurationPersistenceService();
-    when(configurationPersistenceService.getCacheConfig(null)).thenReturn(cacheConfig);
+    when(configurationPersistenceService
+        .getCacheConfig(ConfigurationPersistenceService.CLUSTER_CONFIG)).thenReturn(cacheConfig);
     List<RegionConfig> list = new ArrayList<>();
     list.add(matchingRegion);
     when(cacheConfig.getRegions()).thenReturn(list);
@@ -353,7 +359,8 @@ public class CreateMappingCommandTest {
         mock(ConfigurationPersistenceService.class);
     doReturn(configurationPersistenceService).when(createRegionMappingCommand)
         .getConfigurationPersistenceService();
-    when(configurationPersistenceService.getCacheConfig(null)).thenReturn(cacheConfig);
+    when(configurationPersistenceService
+        .getCacheConfig(ConfigurationPersistenceService.CLUSTER_CONFIG)).thenReturn(cacheConfig);
     List<RegionConfig> list = new ArrayList<>();
     list.add(matchingRegion);
     when(cacheConfig.getRegions()).thenReturn(list);


Mime
View raw message