IndexConfigManager extends CacheConfigurationManager<Index> { @Override public void add(Index config, CacheConfig existing) { RegionConfig regionConfig = existing.findRegionConfiguration(config.getRegionName()); if (regionConfig == null) { throw new IllegalArgumentException( "Region provided does not exist: " + config.getRegionName()); } RegionConfig.Index index = converter.fromConfigObject(config); regionConfig.getIndexes().add(index); } IndexConfigManager(ConfigurationPersistenceService persistenceService); @Override void add(Index config, CacheConfig existing); @Override void update(Index config, CacheConfig existing); @Override void delete(Index config, CacheConfig existing); @Override List<Index> list(Index filterConfig, CacheConfig existing); @Override Index get(Index config, CacheConfig existing);  }
@Test public void add_regionNotFound() { setupCacheConfig(); index.setName("index3"); index.setIndexType(IndexType.RANGE); index.setRegionPath("region3"); assertThatThrownBy(() -> manager.add(index, cacheConfig)) .isInstanceOf(IllegalArgumentException.class) .hasMessageContaining("Region provided does not exist: region3"); }