com.smartbear.readyapi.client.assertions.DefaultJdbcTimeoutAssertionBuilder 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.JdbcTimeoutAssertion;
import java.util.Objects;
public class DefaultJdbcTimeoutAssertionBuilder extends AbstractAssertionBuilder
implements JdbcTimeoutAssertionBuilder {
private final JdbcTimeoutAssertion timeoutAssertion;
public DefaultJdbcTimeoutAssertionBuilder(long timeout) {
this(String.valueOf(timeout));
}
public DefaultJdbcTimeoutAssertionBuilder(String timeout) {
Objects.requireNonNull(timeout);
timeoutAssertion = new JdbcTimeoutAssertion();
timeoutAssertion.setTimeout(timeout);
timeoutAssertion.setType(Assertions.JDBC_TIMEOUT_TYPE);
}
@Override
public DefaultJdbcTimeoutAssertionBuilder named(String name) {
timeoutAssertion.setName(name);
return this;
}
@Override
public JdbcTimeoutAssertion build() {
return timeoutAssertion;
}
public final static JdbcTimeoutAssertion create() {
JdbcTimeoutAssertion assertion = new JdbcTimeoutAssertion();
assertion.setType(Assertions.JDBC_TIMEOUT_TYPE);
return assertion;
}
}