package name.webdizz.fault.tolerance.inventory.client.command;

import static org.hamcrest.core.Is.is;
import static org.junit.Assert.assertThat;
import static name.webdizz.fault.tolerance.inventory.client.InventoryApiTestConstants.DEFAULT_PRODUCT;
import static name.webdizz.fault.tolerance.inventory.client.InventoryApiTestConstants.DEFAULT_STORE;
import static name.webdizz.fault.tolerance.inventory.client.InventoryApiTestConstants.INVENTORY_SERVICE_URL;

import org.junit.Test;
import name.webdizz.fault.tolerance.inventory.client.InventoryRequester;

public class TimeOutInventoryRequestCommandTest {

    private static final int TIMEOUT_IN_MILLIS = 10;
    private InventoryRequester inventoryRequester = new InventoryRequester(INVENTORY_SERVICE_URL);
    private final boolean timedOut = true;

    @Test
    public void shouldNotCompleteInventoryRequestDueToTimeout() {
        TimeOutInventoryRequestCommand timeOutInventoryRequestCommand;
        timeOutInventoryRequestCommand = new TimeOutInventoryRequestCommand(inventoryRequester, DEFAULT_STORE, DEFAULT_PRODUCT, TIMEOUT_IN_MILLIS);
        boolean request = timeOutInventoryRequestCommand.isResponseTimedOut();
        assertThat(request, is(timedOut));
    }
}
@@ -347,212 +347,272 @@
 RE;%0A
+%0A
 import 
-static name.webdizz.fault.tolerance.inventory.client.InventoryApiTestConstants.INVENTORY_SERVICE_URL;%0A%0Aimport org.junit.Test;%0Aimport name.webdizz.fault.tolerance.inventory.client.InventoryRequester
+org.junit.Before;%0Aimport org.junit.Rule;%0Aimport org.junit.Test;%0Aimport name.webdizz.fault.tolerance.inventory.client.InventoryRequester;%0A%0Aimport com.squareup.okhttp.mockwebserver.MockResponse;%0Aimport com.squareup.okhttp.mockwebserver.rule.MockWebServerRule
 ;%0A%0Ap
@@ -715,9 +715,8 @@
  = 1
-0
 ;%0A  
@@ -766,100 +766,338 @@
 ster
- = new InventoryRequester(INVENTORY_SERVICE_URL);%0A    private final boolean timedOut = true;
+;%0A    private final boolean timedOut = true;%0A%0A    @Rule%0A    public final MockWebServerRule server = new MockWebServerRule();%0A%0A    @Before%0A    public void setUp() %7B%0A        server.enqueue(new MockResponse().setBodyDelayTimeMs(100));%0A        inventoryRequester = new InventoryRequester(%22http://127.0.0.1:%22 + server.getPort());%0A    %7D
 %0A%0A  
@@ -1389,16 +1389,66 @@
 ILLIS);%0A
+        timeOutInventoryRequestCommand.execute();%0A
         

Add more real test fixture for time out command