@Test public void worksWithDefaultHost() throws Exception { final Htpasswd htpasswd = new Htpasswd( new DefaultHost( new BucketMocker().mock(), new Host.CloudWatch() { @Override public AmazonCloudWatchClient get() { return Mockito.mock(AmazonCloudWatchClient.class); } } ) ); MatcherAssert.assertThat( htpasswd.authorized("jacky", "pwd"), Matchers.is(false) ); }
@LogExceptions public boolean authorized(@NotNull final String user, @NotNull final String password) throws IOException { final ConcurrentMap<String, String> users = this.fetch(); return users.containsKey(user) && Htpasswd.matches(users.get(user), password); }
Htpasswd { @LogExceptions public boolean authorized(@NotNull final String user, @NotNull final String password) throws IOException { final ConcurrentMap<String, String> users = this.fetch(); return users.containsKey(user) && Htpasswd.matches(users.get(user), password); } }
Htpasswd { @LogExceptions public boolean authorized(@NotNull final String user, @NotNull final String password) throws IOException { final ConcurrentMap<String, String> users = this.fetch(); return users.containsKey(user) && Htpasswd.matches(users.get(user), password); } Htpasswd(@NotNull final Host hst); }
Htpasswd { @LogExceptions public boolean authorized(@NotNull final String user, @NotNull final String password) throws IOException { final ConcurrentMap<String, String> users = this.fetch(); return users.containsKey(user) && Htpasswd.matches(users.get(user), password); } Htpasswd(@NotNull final Host hst); @Override String toString(); @LogExceptions boolean authorized(@NotNull final String user,
        @NotNull final String password); }
Htpasswd { @LogExceptions public boolean authorized(@NotNull final String user, @NotNull final String password) throws IOException { final ConcurrentMap<String, String> users = this.fetch(); return users.containsKey(user) && Htpasswd.matches(users.get(user), password); } Htpasswd(@NotNull final Host hst); @Override String toString(); @LogExceptions boolean authorized(@NotNull final String user,
        @NotNull final String password);  }