com.smartbear.readyapi.client.assertions.DefaultResponseSLAAssertionBuilder Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of ready-api-testserver-client Show documentation
Show all versions of ready-api-testserver-client Show documentation
Java client library for creating and executing test recipes against Ready!API TestServer
The newest version!
package com.smartbear.readyapi.client.assertions;
import com.smartbear.readyapi.client.model.ResponseSLAAssertion;
import static com.smartbear.readyapi.client.Validator.validateNotEmpty;
public class DefaultResponseSLAAssertionBuilder extends AbstractAssertionBuilder
implements ResponseSLAAssertionBuilder {
private ResponseSLAAssertion responseSLAAssertion = new ResponseSLAAssertion();
public DefaultResponseSLAAssertionBuilder(int maxResponseTime) {
responseSLAAssertion.setMaxResponseTime(maxResponseTime);
}
@Override
public DefaultResponseSLAAssertionBuilder named(String name) {
responseSLAAssertion.setName(name);
return this;
}
@Override
public ResponseSLAAssertion build() {
validateNotEmpty(responseSLAAssertion.getMaxResponseTime(), "Missing max response time, it's a mandatory parameter for ResponseSLAAssertion");
responseSLAAssertion.setType(Assertions.RESPONSE_SLA_TYPE);
return responseSLAAssertion;
}
public final static ResponseSLAAssertion create() {
ResponseSLAAssertion assertion = new ResponseSLAAssertion();
assertion.setType(Assertions.RESPONSE_SLA_TYPE);
return assertion;
}
}