All Downloads are FREE. Search and download functionalities are using the official Maven repository.

generator.server.springboot.cucumber.rest.AsyncHeaderAsserter.mustache Maven / Gradle / Ivy

There is a newer version: 1.22.0
Show newest version
package {{packageName}}.cucumber.rest;

import java.time.Duration;

public class AsyncHeaderAsserter implements HeaderAsserter {

  private final Duration maxTime;
  private final AsyncResponseAsserter responseAsserter;
  private final HeaderAssertions assertions;

  AsyncHeaderAsserter(AsyncResponseAsserter responseAsserter, String header, Duration maxTime) {
    this.responseAsserter = responseAsserter;
    this.maxTime = maxTime;
    assertions = new HeaderAssertions(header);
  }

  @Override
  public AsyncHeaderAsserter containing(String value) {
    Awaiter.await(maxTime, () -> assertions.containing(value));

    return this;
  }

  @Override
  public AsyncHeaderAsserter startingWith(String prefix) {
    Awaiter.await(maxTime, () -> assertions.startingWith(prefix));

    return this;
  }

  @Override
  public AsyncResponseAsserter and() {
    return responseAsserter;
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy