- Drops support for Java < 17.
- Support Spring Boot 3.
- Adds
comparesEqualTo
for comparable subjects. - Adds
isEqualToIgnoringWhitespace
for string subjects. - Adds
hasSize
assertion for array subjects. - Adds
keys
andvalues
mappings for map subjects
- Removes the overload of
isNotNull
to avoid overload ambiguity when the subject is a platform type.
- Adds
propertiesAreEqualToIgnoring
assertion. - Adds
isSameInstant
assertion for date/time types.
- Supports Kotlin 1.6
- Add
doesNotContainKey
anddoesNotContainKeys
map assertions
- Supports Kotlin 1.5
- Removes
strikt-gradle
module as classpath isolation is problematic with Kotlin 1.5 and thegradleTestKit
dependency. - Adds
Assertion.Builder<T>.subject : T
property for accessing the subject value.
- Incomplete assertion chains now throw
IncompleteAssertion
. - Suppresses class name in the
toString
of exceptions thrown by Strikt assertions. - Updates
strikt-arrow
to support recent changes in the Arrow library.
- Fixes an issue where pending assertion chains in a block took precedence over failures, causing false positives. See #243
- All transitive dependencies are now resolvable from Maven Central rather than needing JCenter.
- Adds
isContainedIn
assertion.
- Moves several JVM-specific assertions to the new
strikt-jvm
module. - Removes the
strikt-java-time
module (usestrikt-jvm
instead). - Adds
isSorted
assertion forIterable<Comparable<*>>
. - Broadens
isSorted(Comparator)
so that it applies toIterable<*>
rather thanCollection<*>
.
0.28.2 Hidden Ruin - 2021-01-26
- Removes support for Arrow's
Try
type that has been removed fromarrow-core
. - Adds
anyIndexed
,allIndexed
, andnoneIndexed
assertions forIterable<*>
.
- Adds
count()
andcount(predicate)
mappings forIterable
subjects. - Additional support for
File
subjects. See #230- mapping property
Assertion.Builder<File>.parentFile: Builder<File>
- mapping property
Assertion.Builder<File>.lastModified: Long
- mapping property
Assertion.Builder<File>.length: Long
- mapping property
Assertion.Builder<File>.childFiles: Builder<List<File>>
- mapping function
Assertion.Builder<File>.childFile(name): Builder<File>
- assertion
Assertion.Builder<File>.exists()
- assertion
Assertion.Builder<File>.notExists()
- assertion
Assertion.Builder<File>.isRegularFile()
- assertion
Assertion.Builder<File>.isNotRegularFile()
- assertion
Assertion.Builder<File>.isDirectory()
- assertion
Assertion.Builder<File>.isNotDirectory()
- assertion
Assertion.Builder<File>.isReadable()
- assertion
Assertion.Builder<File>.isNotReadable()
- assertion
Assertion.Builder<File>.isWritable()
- assertion
Assertion.Builder<File>.isNotWritable()
- assertion
Assertion.Builder<File>.isExecutable()
- assertion
Assertion.Builder<File>.isNotExecutable()
- mapping property
- Fixes compilation using Android due to use of private interface methods. See #229
- Assertion chains that use
not
will now report actual values if they fail. See #222
Kotlin 1.4 compatibility
Assertion.Builder<Iterable<E>>withFirst
Assertion.Builder<Iterable<E>>withFirst(predicate)
Assertion.Builder<Iterable<E>>withLast
Assertion.Builder<Iterable<E>>withElementAt
Assertion.Builder<Map<K, V>>withValue
Assertion.Builder<CapturingSlot<T>>withCaptured
in strikt-mockk.
succeeded
andfailed
deprecated in favor ofisSuccess
andisFailure
.- added
Assertion.Builder<Enum<T>>.isOneOf
assertion. single
now displays the number of elements found if it fails. See #210- Improved description of
task
mapping. See #218
strikt-mockk
module.
- New methods:
Assertion.Builder<Iterable<T>>.elementAt
Assertion.Builder<Iterable<T>>.one
Assertion.Builder<ArrayNode>.findValuesAsText
Assertion.Builder<ArrayNode>.textValues
- Fixes filepeek support on Windows
- Fixes missing transitive dependency on
com.christophsturm:filepeek
- Fixes BOM file from previous release
- Improved descriptions associated with Jackson extensions. See #195
- Added
at
mapping forJsonNode
assertions. See #152
- Fixes
IllegalArgumentException
oncompose
when prior assertions have failed because the subject is the wrong type. See #194
Re-release of v0.23.0 following broken release
- Adds
with
function for performing blocks of assertions on a derived subject. See #117 - Many assertion functions may now be used in infix style. See #187
- Improves presentation of multi-line values in expectation output. See #158
- The
expectThat
override that accepts a lambda is nowUnit
rather than returningAssertion.Builder
. See #190
- Adds assertions for sequence of values being present in a list
- Fixes to documentation in Arrow module
- Fixes transitive dependency on opentest4j for consumers
- Updates Arrow dependency
- Fixes documentation link that broke previous release
- New module for assertions on Arrow's
Either
,Try
andOption
types.
- Fixes issues with
and
(see #176) - Kotlin 1.3.50
- Bug-fix for type inference in
succeeded()
. - Improved output for
failed()
.
- Updated exception handling assertions that use Kotlin's
runCatching
andResult<T>
. - Added override for
describedAs
that accepts a lambda.
- Changed
Assertion.Builder<Iterable<*>>.contains
to pass if the argument is an empty list/varargs. - Fixed an out of bounds exception in
Assertion.Builder<Iterable<*>>.containsExactly
Added strikt.gradle
module with some support for testing Gradle's API.
- Adds assertions and mappings for
java.io.File
andjava.nio.file.Path
- Adds assertions for Spring's
ResponseEntity
class.
Fixes issues with bom publication.
Packages a BOM for aligning strikt versions.
Suppresses internal stack frames from exceptions to make it easier to determine where the assertion was raised.
- Adds assertions and mappings for
Assertion.Builder<ClosedRange>
. - Adds
endsWith(Char)
forAssertion.Builder<CharSequence>
.
- Adds
getValue
assertion/mapping forAssertion.Builder<Map<*, *>>
.
- Adds overload of
not
that accepts a block.
- Ensures that chains inside of blocks still fail fast.
- Ensures
get
is runtime type safe. It's now a no-op when preceded by a failing type-narrowing assertion.
Added atLeat
, atMost
and exactly
assertions for iterables.
Extends strikt-jackson
module with further assertion and mapping functions:
hasNodeType(JsonNodeType)
isMissing()
textValue()
numberValue()
booleanValue()
Adds strikt-jackson
module.
Adds isPresent
and isAbsent
assertions for java.util.Optional
along with toNullable
mapping function.
Fixes isSorted
when used in a block.
Adds filter
, filterNot
and filterIsInstance
functions for Assertion.Builder<Iterable<*>>
- Upgrades Strikt to depend on Kotlin 1.3.
expectThrows
is un-deprecated.- Expectations are now compatible with suspending lambdas.
isBefore
andisAfter
instrikt-java-time
now supportZonedDateTime
.
Assertion.Builder<Collection<*>.isSorted
isEqualTo
now has special handling for arrays that compares content usingcontentEquals
.
- Backed out truncation of values in failure messages.
- Backed out truncation of values in failure messages.
- Assertions for
java.time
types moved fromstrikt-core
to newstrikt-java-time
module. Assertion.Builder<Map<*, *>>.isNotEmpty
Assertion.Builder<Array<*>>.toList
Assertion.Builder<CharSequence>.trim
Assertion.Builder<String>.trim
- Added
is(Not)(NullOr)(Empty|Blank)
assertions.
- Changes
get
to use a receiver rather than a parameter. - Adds new
first(predicate)
andflatMap
mapping extensions for iterable subjects.
- Deprecates
chain
in favor of newget
method.
- Added Java 11 build & hopefully fixed site publishing
- Added
isIn
assertion.
Fixes broken dependency declaration in strikt-protobuf
.
Breaking change renaming map
to chain
in order to allow a map method that applies to Assertion.Builder<Iterable<*>>
.
- Revisions to exception assertions.
- Instead of
assertThrows(() -> Unit)
useassertThat(catching(() -> Unit))
- throws' receiver is now
Assertion.Builder<Throwable?>
instead ofAssertion.Builder<() -> Unit>
- Instead of