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

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

Go to download

Java client library for creating and executing test recipes against Ready!API TestServer

There is a newer version: 1.2.1
Show 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 {
    private ResponseSLAAssertion responseSLAAssertion = new ResponseSLAAssertion();

    public DefaultResponseSLAAssertionBuilder(int maxResponseTime) {
        responseSLAAssertion.setMaxResponseTime(maxResponseTime);
    }

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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy