use of com.artipie.http.client.auth.BasicAuthenticator in project maven-adapter by artipie.
the class MavenProxySliceAuthIT method setUp.
@BeforeEach
void setUp() throws Exception {
final Storage storage = new InMemoryStorage();
new TestResource("com/artipie/helloworld").addFilesTo(storage, new Key.From("com", "artipie", "helloworld"));
final String username = "alice";
final String password = "qwerty";
this.server = new VertxSliceServer(MavenProxySliceAuthIT.VERTX, new LoggingSlice(new MavenSlice(storage, (user, action) -> user.name().equals(username), new Authentication.Single(username, password))));
final int port = this.server.start();
this.client.start();
this.proxy = new LoggingSlice(new MavenProxySlice(this.client, URI.create(String.format("http://localhost:%d", port)), new BasicAuthenticator(username, password), Cache.NOP));
}
Aggregations