MappingCommandUtils { public static CacheConfig getCacheConfig(ConfigurationPersistenceService configService, String group) throws PreconditionException { CacheConfig result = configService.getCacheConfig(group); if (result == null) { throw new PreconditionException( "Cache Configuration not found" + ((group.equals(ConfigurationPersistenceService.CLUSTER_CONFIG)) ? "." : " for group " + group + ".")); } return result; }  static CacheConfig getCacheConfig(ConfigurationPersistenceService configService,
      String group); static RegionConfig checkForRegion(String regionName, CacheConfig cacheConfig,
      String groupName); static ArrayList<RegionMapping> getMappingsFromRegionConfig(CacheConfig cacheConfig,
      RegionConfig regionConfig,
      String group); static boolean isMappingSynchronous(CacheConfig cacheConfig, RegionConfig regionConfig); static CacheConfig.AsyncEventQueue findAsyncEventQueue(CacheConfig cacheConfig,
      RegionConfig regionConfig); static boolean isAccessor(RegionAttributesType attributesType); static boolean isPartition(RegionAttributesType attributesType); static String createAsyncEventQueueName(String regionPath);  }
@Test public void getCacheConfigReturnsCorrectCacheConfig() throws PreconditionException { when(configurationPersistenceService.getCacheConfig(GROUPNAME)).thenReturn(cacheConfig); CacheConfig result = MappingCommandUtils.getCacheConfig(configurationPersistenceService, GROUPNAME); assertThat(result).isEqualTo(cacheConfig); }