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

com.smartbear.readyapi.client.assertions.InvalidHttpStatusCodesAssertionBuilder 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.InvalidHttpStatusCodesAssertion;

import static com.smartbear.readyapi.client.Validator.validateNotEmpty;

public class InvalidHttpStatusCodesAssertionBuilder extends ValidHttpStatusCodesAssertionBuilder {

    InvalidHttpStatusCodesAssertionBuilder() {
    }

    @Override
    public InvalidHttpStatusCodesAssertion build() {
        validateNotEmpty(statusCodes, "Missing status codes. Status codes are mandatory for InvalidHttpStatusCodesAssertion");
        InvalidHttpStatusCodesAssertion invalidHttpStatusCodesAssertion = new InvalidHttpStatusCodesAssertion();
        invalidHttpStatusCodesAssertion.setType(Assertions.INVALID_HTTP_STATUS_CODES_TYPE);
        invalidHttpStatusCodesAssertion.setInvalidStatusCodes(statusCodes);
        if (name != null) {
            invalidHttpStatusCodesAssertion.setName(name);
        }
        return invalidHttpStatusCodesAssertion;
    }

    public final static InvalidHttpStatusCodesAssertion create() {
        InvalidHttpStatusCodesAssertion assertion = new InvalidHttpStatusCodesAssertion();
        assertion.setType(Assertions.INVALID_HTTP_STATUS_CODES_TYPE);
        return assertion;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy