Minor changes after review

This commit is contained in:
Alex Theedom 2016-08-22 20:31:30 +01:00
parent 36c62e87e8
commit dec6d5f74e

View File

@ -5,9 +5,7 @@ import com.netflix.hystrix.HystrixCommandGroupKey;
import com.netflix.hystrix.HystrixCommandProperties; import com.netflix.hystrix.HystrixCommandProperties;
import com.netflix.hystrix.HystrixThreadPoolProperties; import com.netflix.hystrix.HystrixThreadPoolProperties;
import com.netflix.hystrix.exception.HystrixRuntimeException; import com.netflix.hystrix.exception.HystrixRuntimeException;
import org.junit.*; import org.junit.Test;
import org.junit.rules.ExpectedException;
import org.junit.runners.MethodSorters;
import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.equalTo;
@ -15,12 +13,12 @@ import static org.hamcrest.Matchers.equalTo;
public class HystrixTimeoutTest { public class HystrixTimeoutTest {
@Test @Test
public void givenInputBobAndDefaultSettings_whenExecuted_thenReturnHelloBob(){ public void givenInputBobAndDefaultSettings_whenCommandExecuted_thenReturnHelloBob(){
assertThat(new CommandHelloWorld("Bob").execute(), equalTo("Hello Bob!")); assertThat(new CommandHelloWorld("Bob").execute(), equalTo("Hello Bob!"));
} }
@Test @Test
public void givenSvcTimeoutOf100AndDefaultSettings_whenExecuted_thenReturnSuccess() public void givenSvcTimeoutOf100AndDefaultSettings_whenRemoteSvcExecuted_thenReturnSuccess()
throws InterruptedException { throws InterruptedException {
HystrixCommand.Setter config = HystrixCommand HystrixCommand.Setter config = HystrixCommand
.Setter .Setter
@ -31,7 +29,7 @@ public class HystrixTimeoutTest {
} }
@Test(expected = HystrixRuntimeException.class) @Test(expected = HystrixRuntimeException.class)
public void givenSvcTimeoutOf10000AndDefaultSettings__whenExecuted_thenExpectHRE() throws InterruptedException { public void givenSvcTimeoutOf10000AndDefaultSettings__whenRemoteSvcExecuted_thenExpectHRE() throws InterruptedException {
HystrixCommand.Setter config = HystrixCommand HystrixCommand.Setter config = HystrixCommand
.Setter .Setter
.withGroupKey(HystrixCommandGroupKey.Factory.asKey("RemoteServiceGroupTest3")); .withGroupKey(HystrixCommandGroupKey.Factory.asKey("RemoteServiceGroupTest3"));
@ -39,7 +37,7 @@ public class HystrixTimeoutTest {
} }
@Test @Test
public void givenSvcTimeoutOf5000AndExecTimeoutOf10000__whenExecuted_thenReturnSuccess() public void givenSvcTimeoutOf5000AndExecTimeoutOf10000_whenRemoteSvcExecuted_thenReturnSuccess()
throws InterruptedException { throws InterruptedException {
HystrixCommand.Setter config = HystrixCommand HystrixCommand.Setter config = HystrixCommand