Class StringSubject
java.lang.Object
com.qaitsolutions.pframe.core.assertion.subjects.Subject
com.qaitsolutions.pframe.core.assertion.subjects.ComparableSubject<String>
com.qaitsolutions.pframe.core.assertion.subjects.StringSubject
Wrapper over
StringSubject
.
- Since:
- 1.0
- Author:
- Iulian Andrei (iulian.andrei@qaitsolutions.com)
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionfinal class
Wrapper overStringSubject.CaseInsensitiveStringComparison
-
Field Summary
-
Constructor Summary
ConstructorsConstructorDescriptionStringSubject
(String actual, String message) Constructor for regular assertions.StringSubject
(String actual, String message, ErrorTracker tracker) Constructor for soft assertions. -
Method Summary
Modifier and TypeMethodDescriptionvoid
contains
(CharSequence string) Fails if the string does not contain the given sequence.void
containsMatch
(String regex) Fails if the string does not contain a match on the given regex.void
containsMatch
(Pattern regex) Fails if the string does not contain a match on the given regex.void
doesNotContain
(CharSequence string) Fails if the string contains the given sequence.void
doesNotContainMatch
(String regex) Fails if the string contains a match on the given regex.void
doesNotContainMatch
(Pattern regex) Fails if the string contains a match on the given regex.void
doesNotMatch
(String regex) Fails if the string matches the given regex.void
doesNotMatch
(Pattern regex) Fails if the string matches the given regex.void
Fails if the string does not end with the given string.void
hasLength
(int expected) Wrapper overStringSubject.hasLength(int)
.Wrapper overStringSubject.ignoringCase()
.void
isEmpty()
Fails if the string is not equal to the zero-length "empty string." Wrapper overStringSubject.isEmpty()
.void
Fails if the string is equal to the zero-length "empty string." Wrapper overStringSubject.isNotEmpty()
.void
Fails if the string does not match the given regex.void
Fails if the string does not match the given regex.void
startsWith
(String string) Fails if the string does not start with the given string.Methods inherited from class com.qaitsolutions.pframe.core.assertion.subjects.ComparableSubject
isAtLeast, isAtMost, isEquivalentAccordingToCompareTo, isGreaterThan, isIn, isLessThan, isNotIn
Methods inherited from class com.qaitsolutions.pframe.core.assertion.subjects.Subject
isAnyOf, isEqualTo, isIn, isInstanceOf, isNoneOf, isNotEqualTo, isNotIn, isNotInstanceOf, isNotNull, isNotSameInstanceAs, isNull, isSameInstanceAs
-
Constructor Details
-
StringSubject
Constructor for regular assertions.- Parameters:
actual
- Current value to be verified.message
- Description of the assertion.
-
StringSubject
Constructor for soft assertions.- Parameters:
actual
- Current value to be verified.message
- Description of the assertion.tracker
- Entity which allows keeping track of existing errors.
-
-
Method Details
-
hasLength
public void hasLength(int expected) Wrapper overStringSubject.hasLength(int)
.- Parameters:
expected
- Value to be verified against.
-
isEmpty
public void isEmpty()Fails if the string is not equal to the zero-length "empty string." Wrapper overStringSubject.isEmpty()
. -
isNotEmpty
public void isNotEmpty()Fails if the string is equal to the zero-length "empty string." Wrapper overStringSubject.isNotEmpty()
. -
contains
Fails if the string does not contain the given sequence. Wrapper overStringSubject.contains(CharSequence)
.- Parameters:
string
- Value to be verified against.
-
doesNotContain
Fails if the string contains the given sequence. Wrapper overStringSubject.doesNotContain(CharSequence)
.- Parameters:
string
- Value to be verified against.
-
startsWith
Fails if the string does not start with the given string. Wrapper overStringSubject.startsWith(String)
.- Parameters:
string
- Value to be verified against.
-
endsWith
Fails if the string does not end with the given string. Wrapper overStringSubject.endsWith(String)
.- Parameters:
string
- Value to be verified against.
-
matches
Fails if the string does not match the given regex. Wrapper overStringSubject.matches(String)
.- Parameters:
regex
- Value to be verified against.
-
matches
Fails if the string does not match the given regex. Wrapper overStringSubject.matches(Pattern)
.- Parameters:
regex
- Value to be verified against.
-
doesNotMatch
Fails if the string matches the given regex. Wrapper overStringSubject.doesNotMatch(String)
.- Parameters:
regex
- Value to be verified against.
-
doesNotMatch
Fails if the string matches the given regex. Wrapper overStringSubject.doesNotMatch(Pattern)
.- Parameters:
regex
- Value to be verified against.
-
containsMatch
Fails if the string does not contain a match on the given regex. Wrapper overStringSubject.containsMatch(Pattern)
.- Parameters:
regex
- Value to be verified against.
-
containsMatch
Fails if the string does not contain a match on the given regex. Wrapper overStringSubject.containsMatch(String)
.- Parameters:
regex
- Value to be verified against.
-
doesNotContainMatch
Fails if the string contains a match on the given regex. Wrapper overStringSubject.doesNotContainMatch(Pattern)
.- Parameters:
regex
- Value to be verified against.
-
doesNotContainMatch
Fails if the string contains a match on the given regex. Wrapper overStringSubject.doesNotContainMatch(String)
.- Parameters:
regex
- Value to be verified against.
-
ignoringCase
Wrapper overStringSubject.ignoringCase()
.
-