com.smartbear.readyapi.client.assertions.DefaultGroovyScriptAssertionBuilder 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
package com.smartbear.readyapi.client.assertions;
import com.smartbear.readyapi.client.model.GroovyScriptAssertion;
import static com.smartbear.readyapi.client.Validator.validateNotEmpty;
public class DefaultGroovyScriptAssertionBuilder extends AbstractAssertionBuilder {
private GroovyScriptAssertion scriptAssertion = new GroovyScriptAssertion();
public DefaultGroovyScriptAssertionBuilder(String script) {
scriptAssertion.setScript(script);
}
@Override
public GroovyScriptAssertion build() {
validateNotEmpty(scriptAssertion.getScript(), "Missing script. Script is a mandatory parameter for ScriptAssertion");
scriptAssertion.setType(Assertions.SCRIPT_ASSERTION_TYPE);
return scriptAssertion;
}
public final static GroovyScriptAssertion create(){
GroovyScriptAssertion assertion = new GroovyScriptAssertion();
assertion.setType(Assertions.SCRIPT_ASSERTION_TYPE);
return assertion;
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy