@Test
public void testSetupHttpClient() throws Exception {

    CloudStore cloudStore = new CloudStore();
    HttpClient client = Mockito.mock(HttpClient.class);
    Mockito.doThrow(new Exception("Invalid client")).when(client).start();
    try {
        cloudStore.setupHttpClient(client);
        fail();
    } catch (ResourceException ex) {
        assertEquals(ex.getCode(), 500);
    }
}