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