assertEquals(commandProperties.executionIsolationThreadTimeoutInMilliseconds().get().intValue(), 987);
}
@Test
public void overriddenProperties() throws Exception {
final TenacityConfiguration overrideConfiguration = new TenacityConfiguration(
new ThreadPoolConfiguration(50, 3, 27, 57, 2000, 20),
new CircuitBreakerConfiguration(1, 2, 3, 2000, 20),
982);
final TenacityPropertyRegister tenacityPropertyRegister = new TenacityPropertyRegister(
ImmutableMap.<TenacityPropertyKey, TenacityConfiguration>of(DependencyKey.OVERRIDE, overrideConfiguration),
new BreakerboxConfiguration(),
mock(ArchaiusPropertyRegister.class));
tenacityPropertyRegister.register();
assertEquals(new TenacitySuccessCommand(DependencyKey.OVERRIDE).execute(), "value");
assertEquals(new TenacitySuccessCommand(DependencyKey.OVERRIDE).queue().get(), "value");
final TenacitySuccessCommand successCommand = new TenacitySuccessCommand(DependencyKey.OVERRIDE);
assertNotEquals(new TenacitySuccessCommand().getCommandProperties().executionIsolationThreadTimeoutInMilliseconds(), overrideConfiguration.getExecutionIsolationThreadTimeoutInMillis());
final HystrixCommandProperties commandProperties = successCommand.getCommandProperties();
assertEquals(commandProperties.executionIsolationThreadTimeoutInMilliseconds().get().intValue(), overrideConfiguration.getExecutionIsolationThreadTimeoutInMillis());
assertEquals(commandProperties.circuitBreakerErrorThresholdPercentage().get().intValue(), overrideConfiguration.getCircuitBreaker().getErrorThresholdPercentage());
assertEquals(commandProperties.circuitBreakerRequestVolumeThreshold().get().intValue(), overrideConfiguration.getCircuitBreaker().getRequestVolumeThreshold());
assertEquals(commandProperties.circuitBreakerSleepWindowInMilliseconds().get().intValue(), overrideConfiguration.getCircuitBreaker().getSleepWindowInMillis());
assertEquals(commandProperties.metricsRollingStatisticalWindowBuckets().get().intValue(), overrideConfiguration.getCircuitBreaker().getMetricsRollingStatisticalWindowBuckets());
assertEquals(commandProperties.metricsRollingStatisticalWindowInMilliseconds().get().intValue(), overrideConfiguration.getCircuitBreaker().getMetricsRollingStatisticalWindowInMilliseconds());
final HystrixThreadPoolProperties threadPoolProperties = successCommand.getThreadpoolProperties();
final ThreadPoolConfiguration threadPoolConfiguration = overrideConfiguration.getThreadpool();
assertEquals(threadPoolProperties.coreSize().get().intValue(), threadPoolConfiguration.getThreadPoolCoreSize());
assertEquals(threadPoolProperties.keepAliveTimeMinutes().get().intValue(), threadPoolConfiguration.getKeepAliveTimeMinutes());
assertEquals(threadPoolProperties.maxQueueSize().get().intValue(), threadPoolConfiguration.getMaxQueueSize());
assertEquals(threadPoolProperties.metricsRollingStatisticalWindowBuckets().get().intValue(), threadPoolConfiguration.getMetricsRollingStatisticalWindowBuckets());
assertEquals(threadPoolProperties.metricsRollingStatisticalWindowInMilliseconds().get().intValue(), threadPoolConfiguration.getMetricsRollingStatisticalWindowInMilliseconds());