BizConfig extends RefreshableConfig { public int releaseMessageNotificationBatch() { int batch = getIntProperty("apollo.release-message.notification.batch", DEFAULT_RELEASE_MESSAGE_NOTIFICATION_BATCH); return checkInt(batch, 1, Integer.MAX_VALUE, DEFAULT_RELEASE_MESSAGE_NOTIFICATION_BATCH); } BizConfig(final BizDBPropertySource propertySource); List<String> eurekaServiceUrls(); int grayReleaseRuleScanInterval(); long longPollingTimeoutInMilli(); int itemKeyLengthLimit(); int itemValueLengthLimit(); Map<Long, Integer> namespaceValueLengthLimitOverride(); boolean isNamespaceLockSwitchOff(); String cloggingUrl(); String cloggingPort(); int appNamespaceCacheScanInterval(); TimeUnit appNamespaceCacheScanIntervalTimeUnit(); int appNamespaceCacheRebuildInterval(); TimeUnit appNamespaceCacheRebuildIntervalTimeUnit(); int accessKeyCacheScanInterval(); TimeUnit accessKeyCacheScanIntervalTimeUnit(); int accessKeyCacheRebuildInterval(); TimeUnit accessKeyCacheRebuildIntervalTimeUnit(); int releaseMessageCacheScanInterval(); TimeUnit releaseMessageCacheScanIntervalTimeUnit(); int releaseMessageScanIntervalInMilli(); int releaseMessageNotificationBatch(); int releaseMessageNotificationBatchIntervalInMilli(); boolean isConfigServiceCacheEnabled(); boolean isAdminServiceAccessControlEnabled(); String getAdminServiceAccessTokens();  }
@Test public void testReleaseMessageNotificationBatch() throws Exception { int someBatch = 20; when(environment.getProperty("apollo.release-message.notification.batch")).thenReturn(String.valueOf(someBatch)); assertEquals(someBatch, bizConfig.releaseMessageNotificationBatch()); }
@Test public void testReleaseMessageNotificationBatchWithDefaultValue() throws Exception { int defaultBatch = 100; assertEquals(defaultBatch, bizConfig.releaseMessageNotificationBatch()); }
@Test public void testReleaseMessageNotificationBatchWithInvalidNumber() throws Exception { int someBatch = -20; int defaultBatch = 100; when(environment.getProperty("apollo.release-message.notification.batch")).thenReturn(String.valueOf(someBatch)); assertEquals(defaultBatch, bizConfig.releaseMessageNotificationBatch()); }
@Test public void testReleaseMessageNotificationBatchWithNAN() throws Exception { String someNAN = "someNAN"; int defaultBatch = 100; when(environment.getProperty("apollo.release-message.notification.batch")).thenReturn(someNAN); assertEquals(defaultBatch, bizConfig.releaseMessageNotificationBatch()); }