com.smartbear.readyapi.client.assertions.XQueryContainsAssertionBuilder 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.XQueryContainsAssertion;
import static com.smartbear.readyapi.client.Validator.validateNotEmpty;
public class XQueryContainsAssertionBuilder extends AbstractAssertionBuilder implements XQueryAssertionBuilder {
private XQueryContainsAssertion xQueryContainsAssertion = new XQueryContainsAssertion();
XQueryContainsAssertionBuilder(String xQuery, String expectedContent) {
xQueryContainsAssertion.setXquery(xQuery);
xQueryContainsAssertion.setExpectedContent(expectedContent);
}
@Override
public XQueryContainsAssertionBuilder named(String name) {
xQueryContainsAssertion.setName(name);
return this;
}
@Override
public XQueryContainsAssertionBuilder allowWildcards() {
xQueryContainsAssertion.setAllowWildcards(true);
return this;
}
@Override
public XQueryContainsAssertion build() {
validateNotEmpty(xQueryContainsAssertion.getXquery(), "Missing XQuery, it's a mandatory parameter for XQueryContainsAssertion");
validateNotEmpty(xQueryContainsAssertion.getExpectedContent(), "Missing expected content, it's a mandatory parameter for XQueryContainsAssertion");
xQueryContainsAssertion.setType(Assertions.XQUERY_MATCH_TYPE);
return xQueryContainsAssertion;
}
public final static XQueryContainsAssertion create() {
XQueryContainsAssertion assertion = new XQueryContainsAssertion();
assertion.setType(Assertions.XQUERY_MATCH_TYPE);
return assertion;
}
}