@Test
public void executeRequestClosesConnection_invalidResponseCode() throws Exception {

    when(mMockConnection.getResponseCode()).thenReturn(-1);
    try {
        mHurlStack.executeRequest(
                new TestRequest.Get(), Collections.<String, String>emptyMap());
        fail("Should have thrown exception");
    } catch (IOException e) {
        verify(mMockConnection).disconnect();
    }
}