Package com.soebes.itf.extension.assertj
Class LogAssert
- All Implemented Interfaces:
org.assertj.core.api.Assert<LogAssert,
,LogClass> org.assertj.core.api.Descriptable<LogAssert>
,org.assertj.core.api.ExtensionPoints<LogAssert,
LogClass>
@API(status=EXPERIMENTAL,
since="0.8.0")
public class LogAssert
extends org.assertj.core.api.AbstractAssert<LogAssert,LogClass>
Assertions related to logging output of Maven.
-
Field Summary
Fields inherited from class org.assertj.core.api.AbstractAssert
actual, info, myself, objects, throwUnsupportedExceptionOnEquals
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionorg.assertj.core.api.ListAssert<String>
debug()
Will give you back the stdout and removes the prefix "[DEBUG] " from all lines.org.assertj.core.api.ListAssert<String>
error()
Will read the stdout and removes the prefix"[ERROR] "
.int
hashCode()
Always returns 1.org.assertj.core.api.ListAssert<String>
info()
Will give you back the stdout and removes the prefix"[INFO] "
(including the single space) from all lines.org.assertj.core.api.ListAssert<String>
plain()
Will read the stdout without any filtering etc.org.assertj.core.api.ListAssert<String>
warn()
Will read the stdout and removes the prefix"[WARNING] "
.Methods inherited from class org.assertj.core.api.AbstractAssert
areEqual, asInstanceOf, asList, assertionError, asString, describedAs, descriptionText, doesNotHave, doesNotHaveSameClassAs, doesNotHaveSameHashCodeAs, doesNotHaveToString, equals, extracting, extracting, failure, failureWithActualExpected, failWithActualExpectedAndMessage, failWithMessage, getWritableAssertionInfo, has, hasSameClassAs, hasSameHashCodeAs, hasToString, inBinary, inHexadecimal, is, isElementOfCustomAssert, isEqualTo, isExactlyInstanceOf, isIn, isIn, isInstanceOf, isInstanceOfAny, isInstanceOfSatisfying, isNot, isNotEqualTo, isNotExactlyInstanceOf, isNotIn, isNotIn, isNotInstanceOf, isNotInstanceOfAny, isNotNull, isNotOfAnyClassIn, isNotSameAs, isNull, isOfAnyClassIn, isSameAs, matches, matches, newListAssertInstance, overridingErrorMessage, overridingErrorMessage, satisfies, satisfies, satisfies, satisfiesAnyOf, satisfiesAnyOf, satisfiesAnyOfForProxy, satisfiesForProxy, setCustomRepresentation, setDescriptionConsumer, setPrintAssertionsDescription, throwAssertionError, usingComparator, usingComparator, usingDefaultComparator, usingRecursiveAssertion, usingRecursiveAssertion, usingRecursiveComparison, usingRecursiveComparison, withFailMessage, withFailMessage, withRepresentation, withThreadDumpOnError
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.assertj.core.api.Descriptable
as, as, as, describedAs
-
Constructor Details
-
Method Details
-
info
Will give you back the stdout and removes the prefix"[INFO] "
(including the single space) from all lines.It can be used to check for a sequence in the log output like this:
assertThat(result) .out() .info() .containsSequence("The first line matching.", "The second line matching");
- Returns:
ListAssert
- Since:
- 0.8.0
- See Also:
-
AbstractIterableAssert.containsSequence(Object[])
-
debug
Will give you back the stdout and removes the prefix "[DEBUG] " from all lines. This could be used like the following:
TheassertThat(result) .out() .debug() .contains("Text to be checked for.");
debug()
will give you back all entries which have the prefix[DEBUG]
. Thedebug()
can be combined with other parts of AssertJ like:
The above example will obviously fail cause there always more than one line of debug output being produced during a Maven build.assertThat(result) .out() .debug() .hasSize(1) // Only a single DEBUG line is allowed. .contains("This is something.");
-
warn
Will read the stdout and removes the prefix"[WARNING] "
. This could be used like the following:
TheassertThat(result) .out() .warn() .containsExactly("Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!");
warn()
will give you back all entries which have the prefix[WARNING]
. Thewarn()
can be combined with other parts of AssertJ like:assertThat(result) .log() .warn() .hasSize(1) // Only a single WARNING is allowed. .contains("Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!");
-
error
Will read the stdout and removes the prefix"[ERROR] "
. This could be used like the following:
TheassertThat(result) .out() .error() .containsExactly("exception.");
error()
will give you back all entries which have the prefix[ERROR]
. -
plain
Will read the stdout without any filtering etc.assertThat(result) .out() .plain() .contains("[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!");
-
hashCode
public int hashCode()Always returns 1.
-