New and noteworthy in Fest Assertions 2.0 - alexruiz/fest-assert-2.x GitHub Wiki
The most up to date source for release notes is release-notes.txt, it contains a summary by version and the issues fixed for the next one.
Small release again, with 2.0M10 you can now use FEST assertions in your Android projects.
You might also have a look at Android assertions provided by square.
2.0M9 is a small bugfix release, its main goal is to fix the incompatibility introduced in 2.0M8 with FEST Reflect. You can now use FEST Assertions 2.0M9 and FEST Reflect 1.4.1 without problems.
Bug :
- github#131 : ObjectArrayAssert.containsExactly() works wrong
- github#138 : containsExactly() throws ArrayIndexOutOfBoundsException.
Breaking changes :
- Remove dependency on AWT : AWT assertions moved to a new module
- Use java 6 instead of java 5
New features :
- github#79 : [String assertions are available on (small) file] (https://github.com/alexruiz/fest-assert-2.x/wiki/Tips-and-tricks#wiki-file-content-string-assertions) by calling contentOf(File) method (Olivier Michallat)
- github#73 : new assertion ListAssert.has(Condition, Index) (Bo Gotthardt)
- github#97 : new assertion ListAssert.is(Condition, Index) (Bo Gotthardt)
- github#50 : new assertion StringAssert.containsOnlyOnce (Pauline Iogna)
Improvement :
- github#87 : Fail.failBecauseExpectedExceptionWasNotThrown now takes a Throwable instead of an Exception
- github#86 : tests : org.fest.assertions.internal contain too much classes
- github#82 : tests : org.fest.assertions.api contain too much classes (Olivier Michallat)
- github#91 : tests : move fail tests in a "fail" subpackage
- github#106 : provide better extensibility by exposing assertion WritableAssertionInfo
- github#74 : ObjectAssert lenient equals assertions now takes inherited fields into account
Bug :
- github#92 : Fix BinaryDiff_diff_File_byteArray_Test test that was failing on windows
- github#104 : containsExactly does not work with SortedSet.
Refactoring :
- Move creation of ArrayLists into a Lists class
- Move creation of Sets to Sets class
- Move Iterable related methods out of the Collections
- Iterables : Rename 'isEmpty' to 'isNullOrEmpty'
- Move back factory of primitive arrays from fest-util back to fest-assert
New features :
- github#43 : New File assertions : hasContent(String content) and hasBinaryContent(byte[] expected) (Olivier Michallat)
- github#48 : Add hasTime assertion to DateAssert (Nicolas Francois and Guillaume Girou)
- github#71 : New File assertions : canRead(), canWrite() (Olivier Demeijer)
Improvement :
- github#12 : overridingErrorMessage should be ported in 2.0
- github#54 : ObjectArrayAssert methods should use T parameter instead of Object
- github#70 : Properties.from should use Iterable (Florent Biville)
- github#73 : maven build should assure that we build a java 5 compatible version
Bug :
- github#75 : ShouldHaveEqualContent unexpected MissingFormatArgumentException.
- github#85 : ShouldHaveTime_create_Test test fails because of time zone dependency.
New features :
- github#29 : MapAssert should have containsKey(), containsValue() and counterparts (Nicolas Francois)
- github#31 : Move isInstanceOf and friends to AbstractAssert (Nicolas Francois)
- github#32 : add class related assertions : hasSameClassAs, doesNotHaveSameClassAs, isExactlyInstanceOf, isOfAnyClassIn and counterparts (Nicolas Francois)
- github#35 : Port containsExactly to Fest 2.0 (was in Fest 1.x) (Nicolas Francois)
- github#42 : Move hasSameSize to EnumerableAssert to make it available in *ArrayAssert (Nicolas Francois)
Improvement :
- github#52 : Remove final on methods to provide better extensibility (FEST-475)
- github#56 : Date assert error message improvement
Bug :
- Fix some error compilation only occuring with oracle jdk 1.7.0_05, error being having two static import with same name.
- github#56 : containsOnly does not handle null elements
New features :
- github#34 : Add generic type to MapAssert (Nicolas Francois)
- github#22 : add base assertion isEqualsToByComparingFields (Nicolas Francois)
- github#23 : Filters now support null value (Joel Costigliola)
- FEST-358 : New numbers assertions : isNotPositive / isNotNegative (Nicolas Francois)
- FEST-476 : Improve error message when comparing numbers with offset (Joel Costigliola)
Improvement :
- Use multiline error message to ease comparing actual and expected (Joel Costigliola)
- Make assertions more type safe (work in progress) (Mikhail Mazursky)
Bug :
- github#26 : fix Lenient Equals By Ignoring Fields (Nicolas Francois)
- Improve type safety
- Refactor custom comparators : introducing custom Comparator specific to group elements
- github#20 : new group assertions : containsAll(Iterable)
- github#16 : new BigDecimalAssert assertions : isEqualTo(String) and isEqualByComparingTo(String)
- Filter API on iterable/array
- Lenient Equals (allows specifying on which properties equality should be performed)
- Array and Iterable new assertion : hasSameSizeAs
- Increase API flexibility : ComparableAssert and AbstractAssert
- isIn() and isNotIn() assertions should take Iterable> instead of Collection>
- Improvements of error messages related to group of objects assertions
- github#9 : Allow custom assertions to have access to their description using descriptionText()
-
Date
assertions : 28 assertions ! - Using a custom comparator instead of
equals()
to compare objects in assertions -
Assertions
class now exposes all assertions related API :assertThat
,fail
API,entry
for Map assertions andanyOf
condition - Richer conditions :
has
,are
,areAtLeast
,areAtMost
, ... - OR assertions with
anyOf
conditions -
isEqualTo
assertion improvement : when expected and actual differ and but not their description, Fest now uses a differentiating description in the error message -
Iterable
assertions -
InputStream
assertions - 3 new exception assertions :
hasMessageStartingWith
,hasMessageContaining
,hasMessageEndingWith
- When an assertion fails, the exception stack is filtered to avoid showing fest stack trace elements
- New List and array assertion :
isSorted
-
isGreaterThan
,isLessThan
,isGreaterThanOrEqualTo
andisLessThanOrEqualTo
work now with primitive wrappers - Fail API :
fail()
method removed - Fail API learned
failBecauseExceptionWasNotThrown(exception class)
- New collection/array assertions :
containsNull
,doesNotContainNull
- New collection assertions :
isSubsetOf
- Xml assertions