/** * Authenticate with HTTP Basic Authorization credentials. * * @param username the username * @param password the password * @return this */ public HttpWaitStrategy withBasicCredentials(String username, String password) { delegateStrategy.withBasicCredentials(username, password); return this; }
@NotNull private HttpWaitStrategy createNodeWaitStrategy() { return new HttpWaitStrategy() .forPath("/pools/default/") .withBasicCredentials(clusterUsername, clusterPassword) .forStatusCode(HTTP_OK) .forResponsePredicate(response -> { try { return Optional.of(MAPPER.readTree(response)) .map(n -> n.at("/nodes/0/status")) .map(JsonNode::asText) .map("healthy"::equals) .orElse(false); } catch (IOException e) { logger().error("Unable to parse response {}", response); return false; } }); }
public InfluxDBContainer(final String version) { super(IMAGE_NAME + ":" + version); waitStrategy = new WaitAllStrategy() .withStrategy(Wait.forHttp("/ping").withBasicCredentials(username, password).forStatusCode(204)) .withStrategy(Wait.forListeningPort()); }
/** * Authenticate with HTTP Basic Authorization credentials. * * @param username the username * @param password the password * @return this */ public HttpWaitStrategy withBasicCredentials(String username, String password) { delegateStrategy.withBasicCredentials(username, password); return this; }
public InfluxDBContainer(final String version) { super(IMAGE_NAME + ":" + version); waitStrategy = new WaitAllStrategy() .withStrategy(Wait.forHttp("/ping").withBasicCredentials(username, password).forStatusCode(204)) .withStrategy(Wait.forListeningPort()); }