@Test public void testBuildLogMessage_ContentNotFound_WithoutStatusLine() { String message = underTest.buildLogContentMessage(null, null); assertThat(message, containsString("Exception {} checking remote for update")); assertThat(message, containsString("proxy repo {} failed to fetch {}")); assertThat(message, containsString("content not in cache.")); }
@VisibleForTesting <X extends Throwable> String buildLogContentMessage(@Nullable final Content content, @Nullable final StatusLine statusLine) { StringBuilder message = new StringBuilder("Exception {} checking remote for update"); if (statusLine == null) { message.append(", proxy repo {} failed to fetch {}"); } else { message.append(", proxy repo {} failed to fetch {} with status line {}"); } if (content == null) { message.append(", content not in cache."); } else { message.append(", returning content from cache."); } return message.toString(); }
ProxyFacetSupport extends FacetSupport implements ProxyFacet { @VisibleForTesting <X extends Throwable> String buildLogContentMessage(@Nullable final Content content, @Nullable final StatusLine statusLine) { StringBuilder message = new StringBuilder("Exception {} checking remote for update"); if (statusLine == null) { message.append(", proxy repo {} failed to fetch {}"); } else { message.append(", proxy repo {} failed to fetch {} with status line {}"); } if (content == null) { message.append(", content not in cache."); } else { message.append(", returning content from cache."); } return message.toString(); } }
ProxyFacetSupport extends FacetSupport implements ProxyFacet { @VisibleForTesting <X extends Throwable> String buildLogContentMessage(@Nullable final Content content, @Nullable final StatusLine statusLine) { StringBuilder message = new StringBuilder("Exception {} checking remote for update"); if (statusLine == null) { message.append(", proxy repo {} failed to fetch {}"); } else { message.append(", proxy repo {} failed to fetch {} with status line {}"); } if (content == null) { message.append(", content not in cache."); } else { message.append(", returning content from cache."); } return message.toString(); }  }
ProxyFacetSupport extends FacetSupport implements ProxyFacet { @VisibleForTesting <X extends Throwable> String buildLogContentMessage(@Nullable final Content content, @Nullable final StatusLine statusLine) { StringBuilder message = new StringBuilder("Exception {} checking remote for update"); if (statusLine == null) { message.append(", proxy repo {} failed to fetch {}"); } else { message.append(", proxy repo {} failed to fetch {} with status line {}"); } if (content == null) { message.append(", content not in cache."); } else { message.append(", returning content from cache."); } return message.toString(); }  URI getRemoteUrl(); @Override Content get(final Context context); static boolean isDownloading(); @Override void invalidateProxyCaches(); }
ProxyFacetSupport extends FacetSupport implements ProxyFacet { @VisibleForTesting <X extends Throwable> String buildLogContentMessage(@Nullable final Content content, @Nullable final StatusLine statusLine) { StringBuilder message = new StringBuilder("Exception {} checking remote for update"); if (statusLine == null) { message.append(", proxy repo {} failed to fetch {}"); } else { message.append(", proxy repo {} failed to fetch {} with status line {}"); } if (content == null) { message.append(", content not in cache."); } else { message.append(", returning content from cache."); } return message.toString(); }  URI getRemoteUrl(); @Override Content get(final Context context); static boolean isDownloading(); @Override void invalidateProxyCaches(); static final String BYPASS_HTTP_ERRORS_HEADER_NAME; static final String BYPASS_HTTP_ERRORS_HEADER_VALUE; }