FaultToleranceConfigManager { public static void putAppConfig(String appName, FaultToleranceConfig value) { if (appName == null) { if (LOGGER.isWarnEnabled()) { LOGGER.warn("App name is null when put fault-tolerance config"); } return; } if (value != null) { APP_CONFIGS.put(appName, value); if (LOGGER.isInfoEnabled(appName)) { LOGGER.infoWithApp(appName, "Get a new resource, value[" + value + "]"); } } else { APP_CONFIGS.remove(appName); if (LOGGER.isInfoEnabled(appName)) { LOGGER.infoWithApp(appName, "Remove a resource, key[" + appName + "]"); } } calcEnable(); }  static void putAppConfig(String appName, FaultToleranceConfig value); static boolean isEnable(); static FaultToleranceConfig getConfig(String appName); static long getTimeWindow(String appName); static long getLeastCallCount(String appName); static long getLeastWindowCount(String appName); static double getLeastWindowExceptionRateMultiple(String appName); static double getWeightDegradeRate(String appName); static boolean isRegulationEffective(String appName); static boolean isDegradeEffective(String appName); static int getDegradeLeastWeight(String appName); static double getWeightRecoverRate(String appName); static int getDegradeMaxIpCount(String appName);  }
@Test public void putAppConfig() throws Exception { FaultToleranceConfigManager.putAppConfig(null, new FaultToleranceConfig()); }