Exemplo n.º 1
0
 public Command(
     String commandKey,
     boolean shouldFail,
     boolean shouldFailWithBadRequest,
     long latencyToAdd,
     int sleepWindow,
     int requestVolumeThreshold) {
   super(
       Setter.withGroupKey(HystrixCommandGroupKey.Factory.asKey("Command"))
           .andCommandKey(HystrixCommandKey.Factory.asKey(commandKey))
           .andCommandPropertiesDefaults(
               HystrixCommandPropertiesTest.getUnitTestPropertiesSetter()
                   .withExecutionTimeoutInMilliseconds(500)
                   .withCircuitBreakerRequestVolumeThreshold(requestVolumeThreshold)
                   .withCircuitBreakerSleepWindowInMilliseconds(sleepWindow)));
   this.shouldFail = shouldFail;
   this.shouldFailWithBadRequest = shouldFailWithBadRequest;
   this.latencyToAdd = latencyToAdd;
 }
Exemplo n.º 2
0
 public TestCircuitBreaker(HystrixCommandKey commandKey) {
   this.metrics =
       getMetrics(commandKey, HystrixCommandPropertiesTest.getUnitTestPropertiesSetter());
   forceShortCircuit = false;
 }