AlterRegionCommand extends SingleGfshCommand { @Override public boolean updateConfigForGroup(String group, CacheConfig cacheConfig, Object configObject) { RegionConfig deltaConfig = (RegionConfig) configObject; RegionConfig existingConfig = find(cacheConfig.getRegions(), deltaConfig.getId()); RegionAttributesType deltaAttributes = deltaConfig.getRegionAttributes(); RegionAttributesType existingAttributes = existingConfig.getRegionAttributes(); existingAttributes.setEntryIdleTime( ExpirationAttributesType.combine(existingAttributes.getEntryIdleTime(), deltaAttributes.getEntryIdleTime())); existingAttributes.setEntryTimeToLive( ExpirationAttributesType.combine(existingAttributes.getEntryTimeToLive(), deltaAttributes.getEntryTimeToLive())); existingAttributes.setRegionIdleTime( ExpirationAttributesType.combine(existingAttributes.getRegionIdleTime(), deltaAttributes.getRegionIdleTime())); existingAttributes.setRegionTimeToLive( ExpirationAttributesType.combine(existingAttributes.getRegionTimeToLive(), deltaAttributes.getRegionTimeToLive())); if (deltaAttributes.getCacheLoader() != null) { if (deltaAttributes.getCacheLoader().equals(DeclarableType.EMPTY)) { existingAttributes.setCacheLoader(null); } else { existingAttributes.setCacheLoader(deltaAttributes.getCacheLoader()); } } if (deltaAttributes.getCacheWriter() != null) { if (deltaAttributes.getCacheWriter().equals(DeclarableType.EMPTY)) { existingAttributes.setCacheWriter(null); } else { existingAttributes.setCacheWriter(deltaAttributes.getCacheWriter()); } } if (!deltaAttributes.getCacheListeners().isEmpty()) { existingAttributes.getCacheListeners().clear(); if (!deltaAttributes.getCacheListeners().get(0).equals(DeclarableType.EMPTY)) { existingAttributes.getCacheListeners().addAll(deltaAttributes.getCacheListeners()); } } if (deltaAttributes.getGatewaySenderIds() != null) { existingAttributes.setGatewaySenderIds(deltaAttributes.getGatewaySenderIds()); } if (deltaAttributes.getAsyncEventQueueIds() != null) { existingAttributes.setAsyncEventQueueIds(deltaAttributes.getAsyncEventQueueIds()); } if (deltaAttributes.isCloningEnabled() != null) { existingAttributes.setCloningEnabled(deltaAttributes.isCloningEnabled()); } EvictionAttributes evictionAttributes = deltaAttributes.getEvictionAttributes(); if (evictionAttributes != null) { String newMax = evictionAttributes.getLruEntryCount().getMaximum(); EvictionAttributes existingEviction = existingAttributes.getEvictionAttributes(); if (existingEviction != null) { if (existingEviction.getLruEntryCount() != null) { existingEviction.getLruEntryCount().setMaximum(newMax); } if (existingEviction.getLruMemorySize() != null) { existingEviction.getLruMemorySize().setMaximum(newMax); } } } return true; }  @CliCommand(value = CliStrings.ALTER_REGION, help = CliStrings.ALTER_REGION__HELP) @CliMetaData(relatedTopic = CliStrings.TOPIC_GEODE_REGION) ResultModel alterRegion(
      @CliOption(key = CliStrings.ALTER_REGION__REGION, mandatory = true,
          optionContext = ConverterHint.REGION_PATH,
          help = CliStrings.ALTER_REGION__REGION__HELP) String regionPath,
      @CliOption(key = {CliStrings.GROUP, CliStrings.GROUPS},
          optionContext = ConverterHint.MEMBERGROUP,
          help = CliStrings.ALTER_REGION__GROUP__HELP) String[] groups,
      @CliOption(key = CliStrings.ALTER_REGION__ENTRYEXPIRATIONIDLETIME,
          help = CliStrings.ALTER_REGION__ENTRYEXPIRATIONIDLETIME__HELP) Integer entryExpirationIdleTime,
      @CliOption(key = CliStrings.ALTER_REGION__ENTRYEXPIRATIONIDLETIMEACTION,
          specifiedDefaultValue = "INVALIDATE",
          help = CliStrings.ALTER_REGION__ENTRYEXPIRATIONIDLETIMEACTION__HELP) ExpirationAction entryExpirationIdleTimeAction,
      @CliOption(key = CliStrings.ALTER_REGION__ENTRYEXPIRATIONTIMETOLIVE,
          help = CliStrings.ALTER_REGION__ENTRYEXPIRATIONTIMETOLIVE__HELP) Integer entryExpirationTTL,
      @CliOption(key = CliStrings.ALTER_REGION__ENTRYEXPIRATIONTTLACTION,
          specifiedDefaultValue = "INVALIDATE",
          help = CliStrings.ALTER_REGION__ENTRYEXPIRATIONTTLACTION__HELP) ExpirationAction entryExpirationTTLAction,
      @CliOption(key = CliStrings.ENTRY_IDLE_TIME_CUSTOM_EXPIRY, specifiedDefaultValue = "",
          help = CliStrings.ENTRY_IDLE_TIME_CUSTOM_EXPIRY_HELP) ClassName entryIdleTimeCustomExpiry,
      @CliOption(key = CliStrings.ENTRY_TTL_CUSTOM_EXPIRY, specifiedDefaultValue = "",
          help = CliStrings.ENTRY_TTL_CUSTOM_EXPIRY_HELP) ClassName entryTTLCustomExpiry,
      @CliOption(key = CliStrings.ALTER_REGION__REGIONEXPIRATIONIDLETIME,
          help = CliStrings.ALTER_REGION__REGIONEXPIRATIONIDLETIME__HELP) Integer regionExpirationIdleTime,
      @CliOption(key = CliStrings.ALTER_REGION__REGIONEXPIRATIONIDLETIMEACTION,
          specifiedDefaultValue = "INVALIDATE",
          help = CliStrings.ALTER_REGION__REGIONEXPIRATIONIDLETIMEACTION__HELP) ExpirationAction regionExpirationIdleTimeAction,
      @CliOption(key = CliStrings.ALTER_REGION__REGIONEXPIRATIONTTL,
          help = CliStrings.ALTER_REGION__REGIONEXPIRATIONTTL__HELP) Integer regionExpirationTTL,
      @CliOption(key = CliStrings.ALTER_REGION__REGIONEXPIRATIONTTLACTION,
          specifiedDefaultValue = "INVALIDATE",
          help = CliStrings.ALTER_REGION__REGIONEXPIRATIONTTLACTION__HELP) ExpirationAction regionExpirationTTLAction,
      @CliOption(key = CliStrings.ALTER_REGION__CACHELISTENER, specifiedDefaultValue = "",
          // split the input only with comma outside of json string
          optionContext = "splittingRegex=,(?![^{]*\\})",
          help = CliStrings.ALTER_REGION__CACHELISTENER__HELP) ClassName[] cacheListeners,
      @CliOption(key = CliStrings.ALTER_REGION__CACHELOADER, specifiedDefaultValue = "",
          help = CliStrings.ALTER_REGION__CACHELOADER__HELP) ClassName cacheLoader,
      @CliOption(key = CliStrings.ALTER_REGION__CACHEWRITER, specifiedDefaultValue = "",
          help = CliStrings.ALTER_REGION__CACHEWRITER__HELP) ClassName cacheWriter,
      @CliOption(key = CliStrings.ALTER_REGION__ASYNCEVENTQUEUEID, specifiedDefaultValue = "",
          help = CliStrings.ALTER_REGION__ASYNCEVENTQUEUEID__HELP) String[] asyncEventQueueIds,
      @CliOption(key = CliStrings.ALTER_REGION__GATEWAYSENDERID, specifiedDefaultValue = "",
          help = CliStrings.ALTER_REGION__GATEWAYSENDERID__HELP) String[] gatewaySenderIds,
      @CliOption(key = CliStrings.ALTER_REGION__CLONINGENABLED, specifiedDefaultValue = "true",
          help = CliStrings.ALTER_REGION__CLONINGENABLED__HELP) Boolean cloningEnabled,
      @CliOption(key = CliStrings.ALTER_REGION__EVICTIONMAX, specifiedDefaultValue = "0",
          help = CliStrings.ALTER_REGION__EVICTIONMAX__HELP) Integer evictionMax); @Override boolean updateConfigForGroup(String group, CacheConfig cacheConfig, Object configObject);  }
@Test public void alterWithCacheWriter() { RegionConfig deltaConfig = getDeltaRegionConfig("alter region --name=regionA --cache-writer=CommandWriter"); RegionAttributesType deltaAttributes = deltaConfig.getRegionAttributes(); assertThat(deltaAttributes.getCacheLoader()).isNull(); assertThat(deltaAttributes.getCacheListeners()).isNotNull().isEmpty(); assertThat(deltaAttributes.getCacheWriter().getClassName()).isEqualTo("CommandWriter"); RegionAttributesType existingAttributes = new RegionAttributesType(); existingAttributes.setCacheLoader(new DeclarableType("CacheLoader")); existingAttributes.setCacheWriter(new DeclarableType("CacheWriter")); existingAttributes.getCacheListeners().add(new DeclarableType("CacheListener")); existingRegionConfig.setRegionAttributes(existingAttributes); command.updateConfigForGroup("cluster", cacheConfig, deltaConfig); assertThat(existingAttributes.getCacheListeners()).hasSize(1); assertThat(existingAttributes.getCacheLoader().getClassName()).isEqualTo("CacheLoader"); assertThat(existingAttributes.getCacheListeners().get(0).getClassName()) .isEqualTo("CacheListener"); assertThat(existingAttributes.getCacheWriter().getClassName()).isEqualTo("CommandWriter"); }
@Test public void alterWithNoCacheWriter() { RegionConfig deltaConfig = getDeltaRegionConfig("alter region --name=regionA --cache-writer=' '"); RegionAttributesType deltaAttributes = deltaConfig.getRegionAttributes(); assertThat(deltaAttributes.getCacheWriter()).isEqualTo(DeclarableType.EMPTY); RegionAttributesType existingAttributes = new RegionAttributesType(); existingAttributes.setCacheWriter(new DeclarableType("CacheWriter")); existingRegionConfig.setRegionAttributes(existingAttributes); command.updateConfigForGroup("cluster", cacheConfig, deltaConfig); assertThat(existingAttributes.getCacheWriter()).isNull(); }
@Test public void alterWithEntryIdleTimeOut() { RegionConfig deltaConfig = getDeltaRegionConfig("alter region --name=regionA --entry-idle-time-expiration=7"); RegionAttributesType.ExpirationAttributesType entryIdleTime = deltaConfig.getRegionAttributes().getEntryIdleTime(); assertThat(entryIdleTime).isNotNull(); assertThat(entryIdleTime.getTimeout()).isEqualTo("7"); assertThat(entryIdleTime.getCustomExpiry()).isNull(); assertThat(entryIdleTime.getAction()).isNull(); RegionAttributesType existingAttributes = new RegionAttributesType(); RegionAttributesType.ExpirationAttributesType expirationAttributesType = new RegionAttributesType.ExpirationAttributesType(10, ExpirationAction.DESTROY.toXmlString(), null, null); existingAttributes.setEntryIdleTime(expirationAttributesType); existingRegionConfig.setRegionAttributes(existingAttributes); command.updateConfigForGroup("cluster", cacheConfig, deltaConfig); RegionAttributesType.ExpirationAttributesType combinedExpirationAttributes = existingRegionConfig.getRegionAttributes().getEntryIdleTime(); assertThat(combinedExpirationAttributes.getTimeout()).isEqualTo("7"); assertThat(combinedExpirationAttributes.getAction()).isEqualTo("destroy"); assertThat(combinedExpirationAttributes.getCustomExpiry()).isNull(); }
@Test public void alterWithEntryIdleTimeOutAction() { RegionConfig deltaConfig = getDeltaRegionConfig( "alter region --name=regionA --entry-idle-time-expiration-action=destroy"); RegionAttributesType.ExpirationAttributesType entryIdleTime = deltaConfig.getRegionAttributes().getEntryIdleTime(); assertThat(entryIdleTime).isNotNull(); assertThat(entryIdleTime.getTimeout()).isNull(); assertThat(entryIdleTime.getCustomExpiry()).isNull(); assertThat(entryIdleTime.getAction()).isEqualTo("destroy"); RegionAttributesType existingAttributes = new RegionAttributesType(); RegionAttributesType.ExpirationAttributesType expirationAttributesType = new RegionAttributesType.ExpirationAttributesType(10, ExpirationAction.INVALIDATE.toXmlString(), null, null); existingAttributes.setEntryIdleTime(expirationAttributesType); existingRegionConfig.setRegionAttributes(existingAttributes); command.updateConfigForGroup("cluster", cacheConfig, deltaConfig); RegionAttributesType.ExpirationAttributesType combinedExpirationAttributes = existingRegionConfig.getRegionAttributes().getEntryIdleTime(); assertThat(combinedExpirationAttributes.getTimeout()).isEqualTo("10"); assertThat(combinedExpirationAttributes.getAction()).isEqualTo("destroy"); assertThat(combinedExpirationAttributes.getCustomExpiry()).isNull(); }
@Test public void alterWithEntryIdleTimeOutCustomExpiry() { RegionConfig deltaConfig = getDeltaRegionConfig("alter region --name=regionA --entry-idle-time-custom-expiry=abc"); RegionAttributesType.ExpirationAttributesType entryIdleTime = deltaConfig.getRegionAttributes().getEntryIdleTime(); assertThat(entryIdleTime).isNotNull(); assertThat(entryIdleTime.getTimeout()).isNull(); assertThat(entryIdleTime.getCustomExpiry().getClassName()).isEqualTo("abc"); assertThat(entryIdleTime.getAction()).isNull(); RegionAttributesType existingAttributes = new RegionAttributesType(); RegionAttributesType.ExpirationAttributesType expirationAttributesType = new RegionAttributesType.ExpirationAttributesType(10, ExpirationAction.INVALIDATE.toXmlString(), null, null); existingAttributes.setEntryIdleTime(expirationAttributesType); existingRegionConfig.setRegionAttributes(existingAttributes); command.updateConfigForGroup("cluster", cacheConfig, deltaConfig); RegionAttributesType.ExpirationAttributesType combinedExpirationAttributes = existingRegionConfig.getRegionAttributes().getEntryIdleTime(); assertThat(combinedExpirationAttributes.getTimeout()).isEqualTo("10"); assertThat(combinedExpirationAttributes.getAction()).isEqualTo("invalidate"); assertThat(combinedExpirationAttributes.getCustomExpiry().getClassName()).isEqualTo("abc"); }
@Test public void alterWithEmptyEntryIdleTimeOutCustomExpiry() { RegionConfig deltaConfig = getDeltaRegionConfig("alter region --name=regionA --entry-idle-time-custom-expiry=''"); RegionAttributesType.ExpirationAttributesType entryIdleTime = deltaConfig.getRegionAttributes().getEntryIdleTime(); assertThat(entryIdleTime).isNotNull(); assertThat(entryIdleTime.getTimeout()).isNull(); assertThat(entryIdleTime.getCustomExpiry()).isEqualTo(DeclarableType.EMPTY); assertThat(entryIdleTime.getAction()).isNull(); RegionAttributesType existingAttributes = new RegionAttributesType(); RegionAttributesType.ExpirationAttributesType expirationAttributesType = new RegionAttributesType.ExpirationAttributesType(10, ExpirationAction.INVALIDATE.toXmlString(), null, null); existingAttributes.setEntryIdleTime(expirationAttributesType); existingRegionConfig.setRegionAttributes(existingAttributes); command.updateConfigForGroup("cluster", cacheConfig, deltaConfig); RegionAttributesType.ExpirationAttributesType combinedExpirationAttributes = existingRegionConfig.getRegionAttributes().getEntryIdleTime(); assertThat(combinedExpirationAttributes.getTimeout()).isEqualTo("10"); assertThat(combinedExpirationAttributes.getAction()).isEqualTo("invalidate"); assertThat(combinedExpirationAttributes.getCustomExpiry()).isNull(); }
@Test public void alterWithCacheListener() { RegionConfig deltaConfig = getDeltaRegionConfig("alter region --name=regionA --cache-listener=abc,def"); List<DeclarableType> cacheListeners = deltaConfig.getRegionAttributes().getCacheListeners(); assertThat(cacheListeners).hasSize(2); assertThat(cacheListeners.get(0).getClassName()).isEqualTo("abc"); assertThat(cacheListeners.get(1).getClassName()).isEqualTo("def"); RegionAttributesType existingAttributes = new RegionAttributesType(); existingAttributes.getCacheListeners().add(new DeclarableType("ghi")); existingRegionConfig.setRegionAttributes(existingAttributes); command.updateConfigForGroup("cluster", cacheConfig, deltaConfig); List<DeclarableType> updatedCacheListeners = existingRegionConfig.getRegionAttributes().getCacheListeners(); assertThat(updatedCacheListeners).hasSize(2); assertThat(updatedCacheListeners.get(0).getClassName()).isEqualTo("abc"); assertThat(updatedCacheListeners.get(1).getClassName()).isEqualTo("def"); assertThat(existingRegionConfig.getRegionAttributes().getEntryIdleTime()).isNull(); }
@Test public void alterWithNoCacheListener() { RegionConfig deltaConfig = getDeltaRegionConfig("alter region --name=regionA --cache-listener=''"); List<DeclarableType> cacheListeners = deltaConfig.getRegionAttributes().getCacheListeners(); assertThat(cacheListeners).hasSize(1); assertThat(cacheListeners.get(0)).isEqualTo(DeclarableType.EMPTY); RegionAttributesType existingAttributes = new RegionAttributesType(); existingAttributes.getCacheListeners().add(new DeclarableType("ghi")); existingRegionConfig.setRegionAttributes(existingAttributes); command.updateConfigForGroup("cluster", cacheConfig, deltaConfig); List<DeclarableType> updatedCacheListeners = existingRegionConfig.getRegionAttributes().getCacheListeners(); assertThat(updatedCacheListeners).hasSize(0); }
@Test public void alterWithCacheLoader() { RegionConfig deltaConfig = getDeltaRegionConfig("alter region --name=regionA --cache-loader=abc"); RegionAttributesType deltaAttributes = deltaConfig.getRegionAttributes(); assertThat(deltaAttributes.getCacheWriter()).isNull(); assertThat(deltaAttributes.getCacheLoader().getClassName()).isEqualTo("abc"); assertThat(deltaAttributes.getCacheListeners()).isNotNull().isEmpty(); RegionAttributesType existingAttributes = new RegionAttributesType(); existingAttributes.getCacheListeners().add(new DeclarableType("def")); existingAttributes.setCacheLoader(new DeclarableType("def")); existingAttributes.setCacheWriter(new DeclarableType("def")); existingRegionConfig.setRegionAttributes(existingAttributes); command.updateConfigForGroup("cluster", cacheConfig, deltaConfig); assertThat(existingAttributes.getCacheListeners()).hasSize(1); assertThat(existingAttributes.getCacheListeners().get(0).getClassName()).isEqualTo("def"); assertThat(existingAttributes.getCacheWriter().getClassName()).isEqualTo("def"); assertThat(existingAttributes.getCacheLoader().getClassName()).isEqualTo("abc"); }
@Test public void alterWithNoCacheLoader() { RegionConfig deltaConfig = getDeltaRegionConfig("alter region --name=regionA --cache-loader=''"); RegionAttributesType deltaAttributes = deltaConfig.getRegionAttributes(); assertThat(deltaAttributes.getCacheLoader()).isEqualTo(DeclarableType.EMPTY); RegionAttributesType existingAttributes = new RegionAttributesType(); existingAttributes.setCacheLoader(new DeclarableType("def")); existingRegionConfig.setRegionAttributes(existingAttributes); command.updateConfigForGroup("cluster", cacheConfig, deltaConfig); assertThat(existingAttributes.getCacheLoader()).isNull(); }
@Test public void alterWithAsyncEventQueueIds() { RegionConfig deltaConfig = getDeltaRegionConfig("alter region --name=regionA --async-event-queue-id=abc,def"); assertThat(deltaConfig.getRegionAttributes().getAsyncEventQueueIds()).isEqualTo("abc,def"); assertThat(deltaConfig.getRegionAttributes().getGatewaySenderIds()).isNull(); RegionAttributesType existingAttributes = new RegionAttributesType(); existingRegionConfig.setRegionAttributes(existingAttributes); existingAttributes.setAsyncEventQueueIds("xyz"); existingAttributes.setGatewaySenderIds("xyz"); command.updateConfigForGroup("cluster", cacheConfig, deltaConfig); assertThat(existingAttributes.getGatewaySenderIds()).isEqualTo("xyz"); assertThat(existingAttributes.getAsyncEventQueueIds()).isEqualTo("abc,def"); }
@Test public void alterWithNoAsyncEventQueueIds() { RegionConfig deltaConfig = getDeltaRegionConfig("alter region --name=regionA --async-event-queue-id=''"); assertThat(deltaConfig.getRegionAttributes().getAsyncEventQueueIds()).isEqualTo(""); assertThat(deltaConfig.getRegionAttributes().getGatewaySenderIds()).isNull(); RegionAttributesType existingAttributes = new RegionAttributesType(); existingRegionConfig.setRegionAttributes(existingAttributes); existingAttributes.setAsyncEventQueueIds("xyz"); existingAttributes.setGatewaySenderIds("xyz"); command.updateConfigForGroup("cluster", cacheConfig, deltaConfig); assertThat(existingAttributes.getGatewaySenderIds()).isEqualTo("xyz"); assertThat(existingAttributes.getAsyncEventQueueIds()).isEqualTo(""); assertThat(existingAttributes.getAsyncEventQueueIdsAsSet()).isNotNull().isEmpty(); }
@Test public void alterWithEvictionMaxWithExistingLruHeapPercentage() { RegionConfig deltaConfig = getDeltaRegionConfig("alter region --name=regionA --eviction-max=20"); RegionAttributesType.EvictionAttributes.LruEntryCount lruEntryCount = deltaConfig.getRegionAttributes().getEvictionAttributes().getLruEntryCount(); assertThat(lruEntryCount.getMaximum()).isEqualTo("20"); RegionAttributesType existingAttributes = new RegionAttributesType(); existingRegionConfig.setRegionAttributes(existingAttributes); command.updateConfigForGroup("cluster", cacheConfig, deltaConfig); assertThat(existingAttributes.getEvictionAttributes()).isNull(); RegionAttributesType.EvictionAttributes evictionAttributes = new RegionAttributesType.EvictionAttributes(); evictionAttributes .setLruHeapPercentage(new RegionAttributesType.EvictionAttributes.LruHeapPercentage()); command.updateConfigForGroup("cluster", cacheConfig, deltaConfig); assertThat(evictionAttributes.getLruEntryCount()).isNull(); assertThat(evictionAttributes.getLruMemorySize()).isNull(); }
@Test public void alterWithEvictionMaxWithExistingLruEntryCount() { RegionConfig deltaConfig = getDeltaRegionConfig("alter region --name=regionA --eviction-max=20"); RegionAttributesType.EvictionAttributes.LruEntryCount lruEntryCount = deltaConfig.getRegionAttributes().getEvictionAttributes().getLruEntryCount(); assertThat(lruEntryCount.getMaximum()).isEqualTo("20"); RegionAttributesType existingAttributes = new RegionAttributesType(); existingRegionConfig.setRegionAttributes(existingAttributes); command.updateConfigForGroup("cluster", cacheConfig, deltaConfig); assertThat(existingAttributes.getEvictionAttributes()).isNull(); RegionAttributesType.EvictionAttributes evictionAttributes = new RegionAttributesType.EvictionAttributes(); existingAttributes.setEvictionAttributes(evictionAttributes); RegionAttributesType.EvictionAttributes.LruEntryCount existingEntryCount = new RegionAttributesType.EvictionAttributes.LruEntryCount(); existingEntryCount.setMaximum("100"); existingEntryCount.setAction(EnumActionDestroyOverflow.LOCAL_DESTROY); evictionAttributes.setLruEntryCount(existingEntryCount); command.updateConfigForGroup("cluster", cacheConfig, deltaConfig); assertThat(evictionAttributes.getLruEntryCount().getMaximum()).isEqualTo("20"); assertThat(evictionAttributes.getLruEntryCount().getAction()) .isEqualTo(EnumActionDestroyOverflow.LOCAL_DESTROY); }
@Test public void alterWithEvictionMaxWithExistingLruMemory() { RegionConfig deltaConfig = getDeltaRegionConfig("alter region --name=regionA --eviction-max=20"); RegionAttributesType.EvictionAttributes.LruEntryCount lruEntryCount = deltaConfig.getRegionAttributes().getEvictionAttributes().getLruEntryCount(); assertThat(lruEntryCount.getMaximum()).isEqualTo("20"); RegionAttributesType existingAttributes = new RegionAttributesType(); existingRegionConfig.setRegionAttributes(existingAttributes); command.updateConfigForGroup("cluster", cacheConfig, deltaConfig); assertThat(existingAttributes.getEvictionAttributes()).isNull(); RegionAttributesType.EvictionAttributes evictionAttributes = new RegionAttributesType.EvictionAttributes(); existingAttributes.setEvictionAttributes(evictionAttributes); RegionAttributesType.EvictionAttributes.LruMemorySize existingMemorySize = new RegionAttributesType.EvictionAttributes.LruMemorySize(); existingMemorySize.setMaximum("100"); existingMemorySize.setAction(EnumActionDestroyOverflow.LOCAL_DESTROY); evictionAttributes.setLruMemorySize(existingMemorySize); command.updateConfigForGroup("cluster", cacheConfig, deltaConfig); assertThat(evictionAttributes.getLruMemorySize().getMaximum()).isEqualTo("20"); assertThat(evictionAttributes.getLruMemorySize().getAction()) .isEqualTo(EnumActionDestroyOverflow.LOCAL_DESTROY); }