    @Test
    public void throwsExceptionWhenConnectionRefused() throws IOException {

        URI localUri = null;
        try {
            setStorageUri("http://127.0.0.1:12345");
            MarkupResult markup = createMarkupResult();
            localUri = URI.create(markup.getMarkupUri());
            _nginxStorageService.store(markup);
            fail("Expected exception not thrown");
        }
        catch (StorageException e) {
            assertTrue(e.getCause() instanceof HttpHostConnectException);
            assertNotNull(localUri);
            assertTrue(Files.exists(Paths.get(localUri)));
        }
    }