DefaultHost implements Host { @Override public boolean authorized(@NotNull final String user, @NotNull final String password) throws IOException { final boolean auth; if (user.equals(this.bucket.key()) && password.equals(this.bucket.secret())) { auth = true; } else { auth = this.htpasswd.authorized(user, password); } return auth; } DefaultHost(@NotNull final Bucket bckt);   DefaultHost(
        @NotNull final Bucket bckt,
        @NotNull final Host.CloudWatch cwatch
    ); @Override String toString(); @Override void close(); @Override @NotNull @SuppressWarnings("PMD.AvoidInstantiatingObjectsInLoops") @Loggable(value = Loggable.DEBUG, ignore = IOException.class) Resource fetch(@NotNull final URI uri,
        @NotNull final Range range, @NotNull final Version version); @Override boolean isHidden(@NotNull final URI uri); @Override boolean authorized(@NotNull final String user,
        @NotNull final String password); @Override String syslog(); @Override Stats stats();  }
@Test public void rejectsAuthorizationWhenInvalidCredentials() throws Exception { MatcherAssert.assertThat( new DefaultHost( new BucketMocker().mock(), this.cloudWatch() ).authorized("1", "2"), Matchers.is(false) ); }