# About Truth
[ ][gh-pages-link][ ][maven-link][ ][github-release][ ][Apache 2.0]
Truth is a [Java] test [assertion framework] that provides assertions/propositions to apply to objects-under-test. It is intended to be used with the JUnit test infrastructure, and can be used in the context of unit or integration tests.
Truth seeks to apply a [fluent interface] to testing, and was inspired by [FEST], and is the [main way that Google writes its android and java tests internally][tott]. Its goal is to allow for tests whose assertions are readable and match a quasi-english style, such as `assertThat(someString).contains("some substring")`. More readable tests make for less error-prone tests.
Truth is an [open-source project hosted at Github][truth-github] and is permissively licensed under [Apache 2.0], and its main website [can be found here][truth-website].
# v 0.29 - pushing towards 1.0
## Newly Supported Types
* AtomicLongMap
## Changes to existing Subjects and Core classes
* Preliminary versions of "Fuzzy Equality" for doubles/floats. See `DoublesSubject` for
new APIs, and we'll be updating the docs on fuzzy equality soon.
* Prefer `isEqualTo` instead of `equals` since that is a method with a fairly precise
meaning in Java, and we were hijacking it. .equals() shouldn't be called on Subject
implementations.
* Multidimensional Array support in `ObjectArraySubject`
* Lots of renames and deprecations.
* SPI/API cleanup
- marking a lot of subjects or their methods final, or noting where we can't
- start making parts of the infrastructure more in line with the Open/Closed Principle
(final methods, etc.)
- stop storing "failure message" in the `TestVerb`, part 1
## New Extensions
* An extension/contrib submodule, for things we want to ship with Truth,
but which may need to be separate artifacts, mostly due to dependency
issues or general bloat. Including our first entry: RE2J
> Support for `MessageLite` protocol buffers is also in extensions, but not released
> in 0.29.
## Fixes
* Some cleanups of generics
* Message improvements:
- Trim some stack trace of the obvious truth frames, to make it clearer where the
locus of error is. (i.e. who needs to see Subject.failComparing() in the stack trace?)
- ThrowableSubject uses string comparision where reasonable (to take advantage of
JUnit's `ComparisonFailure`)
- fix BooleanSubject's handling of `null` in failure messaging
- other message improvements
## Miscellaneous
* Apply `@CheckReturnValue` across a wide range of methods (on by default).
- Users are ***strongly*** advised to use [error-prone] in their builds, to ensure
that this is checked, and the compiler errors out when people fail to call the
following chained methods.
* build and continuous test system fixes
* more recent upstream dependencies
* full formating of the codebase using [google-java-format]
* various improvements from error-prone
* improvements to the examples
* more flesh out some holes in the tests
-----------
> Note: various methods are being deprecated in preparation for 1.0. A penultimate
> pre-1.0 release will be cut with those deprecated methods intact. Then a 1.0 will
> be released with those methods removed. This should give people a chance to
> get the 1.0 features and benefits, but have a nice transition phase.
[gh-pages-link]: http://google.github.io/truth/
[maven-link]:http://search.maven.org/#search%7Cga%7C1%7Ccom.google.truth%20
[github-release]: https://github.com/google/truth/releases/tag/release_0_29
[Java]: https://en.wikipedia.org/wiki/Java_(programming_language)
[assertion framework]: https://dzone.com/articles/brief-overview-java-assertions
[tott]: http://googletesting.blogspot.com/2014/12/testing-on-toilet-truth-fluent.html
[fluent interface]: https://en.wikipedia.org/wiki/Fluent_interface
[FEST]: https://github.com/alexruiz/fest-assert-2.x
[truth-github]: http://github.com/google/truth
[truth-website]: http://google.github.io/truth
[Apache 2.0]: https://github.com/google/truth/blob/master/LICENSE
[release link on github]: https://github.com/google/truth/releases/tag/release_0_29
[google-java-format]: http://github.com/google/google-java-format
[error-prone]: http://github.com/google/error-prone