/** * Waits for the given path. * * @param path the path to check * @return this */ public HttpWaitStrategy forPath(String path) { delegateStrategy.forPath(path); return this; }
/** * Convenience method to return a WaitStrategy for an HTTP endpoint. * * @param path the path to check * @return the WaitStrategy * @see HttpWaitStrategy */ public static HttpWaitStrategy forHttp(String path) { return new HttpWaitStrategy() .forPath(path); }
@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 CouchbaseContainer(String containerName) { super(containerName); withNetwork(Network.SHARED); withNetworkAliases("couchbase-" + Base58.randomString(6)); setWaitStrategy(new HttpWaitStrategy().forPath("/ui/index.html")); }
/** * Waits for the given path. * * @param path the path to check * @return this */ public HttpWaitStrategy forPath(String path) { delegateStrategy.forPath(path); return this; }
/** * Convenience method to return a WaitStrategy for an HTTP endpoint. * * @param path the path to check * @return the WaitStrategy * @see HttpWaitStrategy */ public static HttpWaitStrategy forHttp(String path) { return new HttpWaitStrategy() .forPath(path); }