public HttpAwaitStrategy(Cube<?> cube, DockerClientExecutor dockerClientExecutor, Await params) { super(params.getSleepPollingTime()); this.cube = cube; this.dockerClientExecutor = dockerClientExecutor; if (params.getIterations() != null) { this.pollIterations = params.getIterations(); } if (params.getUrl() != null) { String url = params.getUrl(); if (url.contains(DOCKER_HOST)) { url = url.replaceAll(DOCKER_HOST, dockerClientExecutor.getDockerServerIp()); } try { this.url = new URL(url); } catch (IOException e) { throw new IllegalArgumentException(e); } } else { throw new IllegalArgumentException("Http Await Strategy requires url field"); } if (params.getResponseCode() != null) { this.responseCode = params.getResponseCode(); } if (params.getHeaders() != null) { this.headers = params.getHeaders(); } if (params.getMatch() != null) { this.matcher = params.getMatch(); } }
public HttpAwaitStrategy(Cube<?> cube, DockerClientExecutor dockerClientExecutor, Await params) { super(params.getSleepPollingTime()); this.cube = cube; this.dockerClientExecutor = dockerClientExecutor; if (params.getIterations() != null) { this.pollIterations = params.getIterations(); } if (params.getUrl() != null) { String url = params.getUrl(); if (url.contains(DOCKER_HOST)) { url = url.replaceAll(DOCKER_HOST, dockerClientExecutor.getDockerServerIp()); } try { this.url = new URL(url); } catch (IOException e) { throw new IllegalArgumentException(e); } } else { throw new IllegalArgumentException("Http Await Strategy requires url field"); } if (params.getResponseCode() != null) { this.responseCode = params.getResponseCode(); } if (params.getHeaders() != null) { this.headers = params.getHeaders(); } if (params.getMatch() != null) { this.matcher = params.getMatch(); } }