/**
   * Verify that a remote answering with '403 Forbidden' will not be auto-blocked with and without a
   * local artifact cached.
   */
  @Test
  public void testNoAutoblockOn403() throws Exception {
    stopProxy();

    server = Server.withPort(proxyPort).start();

    server.serve("/").withBehaviours(content("ok"));
    server.serve("/remote/release-proxy-repo-1/nexus4593/*").withBehaviours(get(getTestFile("/")));

    downloadArtifact(GavUtil.newGav("nexus4593", "artifact", "1.0.0"), "target");

    assertThat(ProxyMode.valueOf(getStatus().getProxyMode()), is(ProxyMode.ALLOW));

    server.serve("/*").withBehaviours(error(403));

    // download will not fail because we have a local copy cached, but the remote will be hit b/c
    // maxAge is set to 0
    downloadArtifact(GavUtil.newGav("nexus4593", "artifact", "1.0.0"), "target");

    assertThat(ProxyMode.valueOf(getStatus().getProxyMode()), is(ProxyMode.ALLOW));

    try {
      downloadArtifact(GavUtil.newGav("g", "a", "403"), "target");
      assertThat("should fail b/c of 403", false);
    } catch (IOException e) {
      // expected, remote will answer with 403
    }

    assertThat(ProxyMode.valueOf(getStatus().getProxyMode()), is(ProxyMode.ALLOW));
  }