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

com.smartbear.readyapi.client.assertions.DefaultJdbcTimeoutAssertionBuilder Maven / Gradle / Ivy

Go to download

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;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy