![JAR search and dependency download from the Maven repository](/logo.png)
com.insightfullogic.lambdabehave.expectations.StringExpectation Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of lambda-behave Show documentation
Show all versions of lambda-behave Show documentation
A modern testing and behavioural specification framework for Java 8
package com.insightfullogic.lambdabehave.expectations;
import org.hamcrest.Matcher;
import org.hamcrest.Matchers;
import static org.junit.Assert.assertThat;
/**
* .
*/
public final class StringExpectation extends BoundExpectation {
public StringExpectation(final String str, final boolean positive) {
super(str, positive);
}
public StringExpectation isEmptyString() {
return matches(Matchers.isEmptyString());
}
public StringExpectation isEmptyOrNullString() {
return matches(Matchers.isEmptyOrNullString());
}
public StringExpectation equalToIgnoringCase(final String expectedString) {
return matches(Matchers.equalToIgnoringCase(expectedString));
}
public StringExpectation equalToIgnoringWhiteSpace(final String expectedString) {
return matches(Matchers.equalToIgnoringWhiteSpace(expectedString));
}
public StringExpectation containsString(final String substring) {
return matches(Matchers.containsString(substring));
}
public StringExpectation endsWith(final String suffix) {
return matches(Matchers.endsWith(suffix));
}
public StringExpectation startsWith(final String prefix) {
return matches(Matchers.startsWith(prefix));
}
private StringExpectation matches(final Matcher matcher) {
assertThat(objectUnderTest, matcher);
return this;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy