Bot releases are hidden (Show)
Published by robstoll 7 months ago
Full Changelog: https://github.com/robstoll/atrium/compare/v1.1.0...v1.2.0
showOnlyIf
parameter which allows to define an optional predicate next to the check that the subject is present (otherwise the failure hint is not shown) #1674We will make a major refactoring on core and logic level. Those changes should not affect most Atrium users. It might affect you if you:
assertionBuilder
or other types which are defined in core or logic.en_GB
from package namesMigration steps/pointers will be provided in the release notes as usual.
The following changes are planned:
Assertion
with Proof
and along with it rename many types incorporating Assertion in its name or in its package's name => we will remove Assertion and co. with 1.5.0 at the latest)ch.tutteli.atrium.reporting
will be affected (could be we move this to 1.3.0)Planned (previously deprecated or announced)
Unplanned
expect(...).withOptions
provide it in a different formUse the ReplaceWith in the corresponding @Deprecated
annotations.
Please have a look at older release-notes in case you don't migrate from 1.0.0
We would like to thank (Tegonal Cooperative, Bern, Switzerland) for sponsoring the time @robstoll is working on Atrium.
Are you using Atrium at work?
Please consider to support the project as well by:
Published by robstoll 12 months ago
Full Changelog: https://github.com/robstoll/atrium/compare/v1.0.0...v1.1.0
CharSequence.toContain....matchFor(Regex)
as replacement for ...regex(Regex)
#1499CharSequence.toContain....regex(Regex)
=> use ...matchFor(Regex)
We plan to make a major refactoring on core and logic level. Those changes should not affect most Atrium users. It might affect you if you:
assertionBuilder
or other types which are defined in core or logic.en_GB
from package namesMigration steps/pointers will be provided in the release notes as usual.
The following changes are planned:
Assertion
with Proof
and along with it rename many types incorporating Assertion in its name or in its package's name => we will remove Assertion and co. with 1.5.0 at the latest)ch.tutteli.atrium.reporting
will be affected (could be we move this to 1.3.0)Planned (previously deprecated or announced)
Unplanned
ch.tutteli.atrium.api.fluent.en_GB.creating.charsequence.contains
to charsequence.toCtonain` but dropped the old instead of deprecation -- same same for the infix API => this is a binary backward-compatibility break, please re-compileMap... the keyValues
from keyValues to entries since keyValues
is deprecated in favour of entries
. We don't expect that people are using named parameters with the infix API (as they disallow to use a function as infix call). But in cas you do, then please give feedback.expect(...).withOptions
provide it in a different formUse the ReplaceWith in the corresponding @Deprecated
annotations.
Please have a look at older release-notes in case you don't migrate from 1.0.0
We would like to thank (Tegonal Cooperative, Bern, Switzerland) for sponsoring the time @robstoll is working on Atrium.
Are you using Atrium at work?
Please consider to support the project as well by:
Published by robstoll over 1 year ago
This is an extra release so that Atrium can be used with JS using the IR compiler backend.
Note that's not the final 1.1.0 version and that:
import ch.tutteli.atrium.api.fluent.en_GB.kotlin_1_3
and replace with import ch.tutteli.atrium.api.fluent.en_GB
<unknown> (js: ...)
in reporting, then it's due to the breaking change => I assume Atrium should still be usable in 99.99% of the casesPublished by robstoll over 1 year ago
Full Changelog: https://github.com/robstoll/atrium/compare/v0.18.0...v1.0.0
expect
in preparation of #1330not to contain
#1156build
samples
migrations
Sadly, we had to move back to Spek for the moment as kotest is buggy in terms of the JS platform. Kotlin-test (i.e. all samples) where no longer run as soon as kotest was specified as dependency
ch.tutteli.atrium.api.fluent.en_GB.creating.charsequence.contains
to charsequence.toCtonain` and thus deprecated the existing packages (will be dropped with 1.5.0 latest) -- same same for the infix APIen_GB
from package namesWe will make a major refactoring on core and logic level. Those changes should not affect most Atrium users. It might affect you if you:
assertionBuilder
or other types which are defined in core or logic.Migration steps/pointers will be provided in the release notes as usual.
The following changes are planned:
Assertion
with Proof
and along with it rename many types incorporating Assertion in its name or in its package's name => we will remove Assertion and co. with 1.5.0 at the latest)ch.tutteli.atrium.reporting
will be affected (could be we move this to 1.3.0)Planned (previously deprecated or announced)
Unplanned
Use the ReplaceWith in the corresponding @Deprecated
annotations.
Please have a look at older release-notes in case you don't migrate from 0.18.0
We would like to thank (Tegonal Cooperative, Bern, Switzerland) for sponsoring the time @robstoll is working on Atrium.
Are you using Atrium at work?
Please consider to support the project as well by:
Published by robstoll over 2 years ago
to + infinitive
schemaI expected...
#1090inGiven order and only
in api-infix #1050We will make a major refactoring on core and logic level. Those changes should not affect most Atrium users. It will affect you if you:
assertionBuilder
or other types which are defined in core or logic.Migration steps/pointers will be provided in the release notes as usual.
The following changes are planned:
Assertion
with Proof
and along with it rename many types incorporating Assertion in its name or in its package's name => we will remove Assertion and co. with 0.22.0 at the latest)ch.tutteli.atrium.reporting
will be affected (could be we move this to 0.21.0)Planned (previously deprecated or announced)
assert
and assertThat
as they do not fit the to + infinitive naming schema => switch to expect
to + infinitive
convention from ...Assertions.kt to the corresponding ...Expectations.kt file which is a binary breaking change => please re-compile your sourcesUnplanned
inAnyOrder.only
=> please re-compileinOrder.only.grouped
=> please re-compileFirst of all, see deprecation above which will be removed with 0.19.0, some of them are breaking as well
See atrium-roadmap -> Milestone 1.0.0
Use the ReplaceWith in the corresponding @Deprecated
annotations.
Please have a look at older release-notes in case you don't migrate from 0.17.0
We would like to thank (Tegonal GmbH, Bern, Switzerland) for sponsoring the time @robstoll is working on Atrium.
Are you using Atrium at work?
Please consider to support the project as well by:
Published by robstoll almost 3 years ago
assert
and assertThat
as they do not fit the to + infinitive naming schema; they will be removed with 0.18.0 => switch to expectto + infinitive
naming schema => see migration further belowto + infinitive
naming schemaWe will make a major refactoring on core and logic level where we will:
Assertion
with Proof
and along with it rename many types incorporating Assertion in its name or in its package's name => we will remove Assertion and co. with 0.21.0 at the latest)ch.tutteli.atrium.reporting
will be affected (could be we move this to 0.20.0)Those changes should not affect most Atrium users. It will affect you if you:
assertionBuilder
or other types which are defined in core or logic.Migration steps/pointers will be provided in the release notes as usual.
Planned (previously deprecated or announced)
Unplanned
First of all, see deprecation above which will be removed with 0.18.0, some of them are breaking as well
to + infinitive
convention from ...Assertions.kt to the corresponding ...Expectations.kt file which is a binary breaking change => please re-compile your sourcesSee atrium-roadmap -> Milestone 1.0.0
The following command is carrying out some search & replace so that you don't need to rely on the (unfortunately sometimes buggy) behaviour of ReplaceWith.
find . -type f -name "*.kt" -a \( -path "*/src/test/*" -o -path "*/src/*Test/*" \) | xargs perl -0777 -i \
-pe 's/import ch.tutteli.atrium.api.verbs.(assert|assertThat)\n/import ch.tutteli.atrium.api.verbs.expect\n/g;' \
-pe 's/(assert|assertThat)(\(| ?\{)/expect$2/g;' \
-pe 's/import ch.tutteli.atrium.api.(fluent|infix).en_GB.toBe\n/import ch.tutteli.atrium.api.$1.en_GB.toEqual\n/g;' \
-pe 's/([\. ])toBe([\( ])/$1toEqual$2/g;' \
-pe 's/import ch.tutteli.atrium.api.(fluent|infix).en_GB.notToBe\n/import ch.tutteli.atrium.api.$1.en_GB.notToEqual\n/g;' \
-pe 's/([\. ])notToBe([\( ])/$1notToEqual$2/g;' \
-pe 's/import ch.tutteli.atrium.api.(fluent|infix).en_GB.isSameAs\n/import ch.tutteli.atrium.api.$1.en_GB.toBeTheInstance\n/g;' \
-pe 's/([\. ])isSameAs([\( ])/$1toBeTheInstance$2/g;' \
-pe 's/import ch.tutteli.atrium.api.(fluent|infix).en_GB.isNotSameAs\n/import ch.tutteli.atrium.api.$1.en_GB.notToBeTheInstance\n/g;' \
-pe 's/([\. ])isNotSameAs([\( ])/$1notToBeTheInstance$2/g;' \
-pe 's/import ch.tutteli.atrium.api.(fluent|infix).en_GB.notToBeNull\n/import ch.tutteli.atrium.api.$1.en_GB.notToEqualNull\n/g;' \
-pe 's/([\. ])notToBeNull([\( ])/$1notToEqualNull$2/g;' \
-pe 's/import ch.tutteli.atrium.api.(fluent|infix).en_GB.isA\n/import ch.tutteli.atrium.api.$1.en_GB.toBeAnInstanceOf\n/g;' \
-pe 's/([\. ])isA</$toBeAnInstanceOf</g;' \
-pe 's/import ch.tutteli.atrium.api.(fluent|infix).en_GB.isNoneOf\n/import ch.tutteli.atrium.api.$1.en_GB.notToBeOneOf\n/g;' \
-pe 's/([\. ])isNoneOf([\( ])/$1notToBeOneOf$2/g;' \
-pe 's/import ch.tutteli.atrium.api.(fluent|infix).en_GB.isNotIn\n/import ch.tutteli.atrium.api.$1.en_GB.notToBeIn\n/g;' \
-pe 's/([\. ])isNotIn([\( ])/$1notToBeIn$2/g;' \
-pe 's/import ch.tutteli.atrium.api.(fluent|infix).en_GB.contains\n/import ch.tutteli.atrium.api.$1.en_GB.toContain\n/g;' \
-pe 's/([\. ])contains([\( \.])/$1toContain$2/g;' \
-pe 's/import ch.tutteli.atrium.api.(fluent|infix).en_GB.containsNot\n/import ch.tutteli.atrium.api.$1.en_GB.notToContain\n/g;' \
-pe 's/([\. ])containsNot([\( \.])/$1notToContain$2/g;' \
-pe 's/import ch.tutteli.atrium.api.(fluent|infix).en_GB.containsRegex\n/import ch.tutteli.atrium.api.$1.en_GB.toContainRegex\n/g;' \
-pe 's/([\. ])containsRegex([\( ])/$1toContainRegex$2/g;' \
-pe 's/import ch.tutteli.atrium.api.(fluent|infix).en_GB.contains\n/import ch.tutteli.atrium.api.$1.en_GB.toContain\n/g;' \
-pe 's/([\. ])contains([\( ])/$1toContain$2/g;' \
-pe 's/import ch.tutteli.atrium.api.(fluent|infix).en_GB.startsWith\n/import ch.tutteli.atrium.api.$1.en_GB.toStartWith\n/g;' \
-pe 's/([\. ])startsWith([\( ])/$1toStartWith$2/g;' \
-pe 's/import ch.tutteli.atrium.api.(fluent|infix).en_GB.startsNotWith\n/import ch.tutteli.atrium.api.$1.en_GB.notToStartWith\n/g;' \
-pe 's/([\. ])startsNotWith([\( ])/$1notToStartWith$2/g;' \
-pe 's/import ch.tutteli.atrium.api.(fluent|infix).en_GB.endsWith\n/import ch.tutteli.atrium.api.$1.en_GB.toEndWith\n/g;' \
-pe 's/([\. ])endsWith([\( ])/$1toEndWith$2/g;' \
-pe 's/import ch.tutteli.atrium.api.(fluent|infix).en_GB.endsNotWith\n/import ch.tutteli.atrium.api.$1.en_GB.notToEndWith\n/g;' \
-pe 's/([\. ])endsNotWith([\( ])/$1notToEndWith$2/g;' \
-pe 's/import ch.tutteli.atrium.api.fluent.en_GB.isEmpty\n/import ch.tutteli.atrium.api.fluent.en_GB.toBeEmpty\n/g;' \
-pe 's/([\. ])isEmpty\(/$1toBeEmpty\(/g;' \
-pe 's/import ch.tutteli.atrium.api.fluent.en_GB.isNotEmpty\n/import ch.tutteli.atrium.api.fluent.en_GB.notToBeEmpty\n/g;' \
-pe 's/([\. ])isNotEmpty\(/$1notToBeEmpty\(/g;' \
-pe 's/import ch.tutteli.atrium.api.fluent.en_GB.isNotBlank\n/import ch.tutteli.atrium.api.fluent.en_GB.notToBeBlank\n/g;' \
-pe 's/([\. ])isNotBlank\(/notToBeBlank\(/g;' \
-pe 's/import ch.tutteli.atrium.api.(fluent|infix).en_GB.matches\n/import ch.tutteli.atrium.api.$1.en_GB.toMatch\n/g;' \
-pe 's/([\. ])matches([\( ])/$1toMatch$2/g;' \
-pe 's/import ch.tutteli.atrium.api.(fluent|infix).en_GB.mismatches\n/import ch.tutteli.atrium.api.$1.en_GB.notToMatch\n/g;' \
-pe 's/([\. ])mismatches([\( ])/$1notToMatch$2/g;' \
-pe 's/import ch.tutteli.atrium.api.(fluent|infix).en_GB.hasSize\n/import ch.tutteli.atrium.api.$1.en_GB.toHaveSize\n/g;' \
-pe 's/([\. ])hasSize([\( ])/$1toHaveSize$2/g;' \
-pe 's/import ch.tutteli.atrium.api.(fluent|infix).en_GB.isLessThan\n/import ch.tutteli.atrium.api.$1.en_GB.toBeLessThan\n/g;' \
-pe 's/([\. ])isLessThan([\( ])/$1toBeLessThan$2/g;' \
-pe 's/import ch.tutteli.atrium.api.(fluent|infix).en_GB.isLessThanOrEqual\n/import ch.tutteli.atrium.api.$1.en_GB.toBeLessThanOrEqualTo\n/g;' \
-pe 's/([\. ])isLessThanOrEqual([\( ])/$1toBeLessThanOrEqualTo$2/g;' \
-pe 's/import ch.tutteli.atrium.api.(fluent|infix).en_GB.isGreaterThan\n/import ch.tutteli.atrium.api.$1.en_GB.toBeGreaterThan\n/g;' \
-pe 's/([\. ])isGreaterThan([\( ])/$1toBeGreaterThan$2/g;' \
-pe 's/import ch.tutteli.atrium.api.(fluent|infix).en_GB.isGreaterThanOrEqualTo\n/import ch.tutteli.atrium.api.$1.en_GB.toBeGreaterThanOrEqualTo\n/g;' \
-pe 's/([\. ])isGreaterThanOrEqual([\( ])/$1toBeGreaterThanOrEqual$2/g;' \
-pe 's/import ch.tutteli.atrium.api.(fluent|infix).en_GB.isEqualComparingTo\n/import ch.tutteli.atrium.api.$1.en_GB.toBeEqualComparingTo\n/g;' \
-pe 's/([\. ])isEqualComparingTo([\( ])/$1toBeEqualComparingTo$2/g;' \
-pe 's/import ch.tutteli.atrium.api.(fluent|infix).en_GB.toBeWithErrorTolerance\n/import ch.tutteli.atrium.api.$1.en_GB.toEqualWithErrorTolerance\n/g;' \
-pe 's/([\. ])toBeWithErrorTolerance([\( ])/$1toEqualWithErrorTolerance$2/g;' \
-pe 's/import ch.tutteli.atrium.api.(fluent|infix).en_GB.containsExactly\n/import ch.tutteli.atrium.api.$1.en_GB.toContainExactly\n/g;' \
-pe 's/([\. ])containsExactly([\( ])/$1toContainExactly$2/g;' \
-pe 's/import ch.tutteli.atrium.api.(fluent|infix).en_GB.containsExactlyElementsOf\n/import ch.tutteli.atrium.api.$1.en_GB.toContainExactlyElementsOf\n/g;' \
-pe 's/([\. ])containsExactlyElementsOf([\( ])/$1toContainExactlyElementsOf$2/g;' \
-pe 's/import ch.tutteli.atrium.api.(fluent|infix).en_GB.containsElementsOf\n/import ch.tutteli.atrium.api.$1.en_GB.toContainElementsOf\n/g;' \
-pe 's/([\. ])containsElementsOf([\( ])/$1toContainElementsOf$2/g;' \
-pe 's/import ch.tutteli.atrium.api.(fluent|infix).en_GB.any\n/import ch.tutteli.atrium.api.$1.en_GB.toHaveElementsAndAny\n/g;' \
-pe 's/([\. ])any([\( ])/$1toHaveElementsAndAny$2/g;' \
-pe 's/import ch.tutteli.atrium.api.(fluent|infix).en_GB.none\n/import ch.tutteli.atrium.api.$1.en_GB.toHaveElementsAndNone\n/g;' \
-pe 's/([\. ])none([\( ])/$1toHaveElementsAndNone$2/g;' \
-pe 's/import ch.tutteli.atrium.api.(fluent|infix).en_GB.all\n/import ch.tutteli.atrium.api.$1.en_GB.toHaveElementsAndAll\n/g;' \
-pe 's/([\. ])all([\( ])/$1toHaveElementsAndAll$2/g;' \
-pe 's/import ch.tutteli.atrium.api.(fluent|infix).en_GB.all\n/import ch.tutteli.atrium.api.$1.en_GB.toHaveElementsAndAll\n/g;' \
-pe 's/([\. ])all([\( ])/$1toHaveElementsAndAll$2/g;' \
-pe 's/import ch.tutteli.atrium.api.(fluent|infix).en_GB.containsNoDuplicates\n/import ch.tutteli.atrium.api.$1.en_GB.toHaveElementsAndNoDuplicates\n/g;' \
-pe 's/([\. ])containsNoDuplicates([\( ])/$toHaveElementsAndNoDuplicates$2/g;' \
-pe 's/import ch.tutteli.atrium.api.(fluent|infix).en_GB.containsOnly\n/import ch.tutteli.atrium.api.$1.en_GB.toContainOnly\n/g;' \
-pe 's/([\. ])containsOnly([\( ])/$1toContainOnly$2/g;' \
-pe 's/import ch.tutteli.atrium.api.(fluent|infix).en_GB.containsEntriesOf\n/import ch.tutteli.atrium.api.$1.en_GB.toContainEntriesOf\n/g;' \
-pe 's/([\. ])containsEntriesOf([\( ])/$1toContainEntriesOf$2/g;' \
-pe 's/import ch.tutteli.atrium.api.(fluent|infix).en_GB.containsOnlyEntriesOf\n/import ch.tutteli.atrium.api.$1.en_GB.toContainOnlyEntriesOf\n/g;' \
-pe 's/([\. ])containsOnlyEntriesOf([\( ])/$1toContainOnlyEntriesOf$2/g;' \
-pe 's/import ch.tutteli.atrium.api.(fluent|infix).en_GB.containsKey\n/import ch.tutteli.atrium.api.$1.en_GB.toContainKey\n/g;' \
-pe 's/([\. ])containsKey([\( ])/$1toContainKey$2/g;' \
-pe 's/import ch.tutteli.atrium.api.(fluent|infix).en_GB.containsNotKey\n/import ch.tutteli.atrium.api.$1.en_GB.notToContainKey\n/g;' \
-pe 's/([\. ])containsNotKey([\( ])/$1notToContainKey$2/g;' \
-pe 's/import ch.tutteli.atrium.api.(fluent|infix).en_GB.isKeyValue\n/import ch.tutteli.atrium.api.$1.en_GB.toEqualKeyValue\n/g;' \
-pe 's/([\. ])isKeyValue([\( ])/$1toEqualKeyValue$2/g;' \
-pe 's/import ch.tutteli.atrium.api.(fluent|infix).en_GB.messageContains\n/import ch.tutteli.atrium.api.$1.en_GB.messageToContain\n/g;' \
-pe 's/([\. ])messageContains([\( ])/$1messageToContain$2/g;' \
-pe 's/import ch.tutteli.atrium.api.(fluent|infix).en_GB.isNumericallyEqualTo\n/import ch.tutteli.atrium.api.$1.en_GB.toEqualNumerically\n/g;' \
-pe 's/([\. ])isNumericallyEqualTo([\( ])/$1toEqualNumerically$2/g;' \
-pe 's/import ch.tutteli.atrium.api.(fluent|infix).en_GB.isNotNumericallyEqualTo\n/import ch.tutteli.atrium.api.$1.en_GB.notToEqualNumerically\n/g;' \
-pe 's/([\. ])isNotNumericallyEqualTo([\( ])/$1notToEqualNumerically$2/g;' \
-pe 's/import ch.tutteli.atrium.api.(fluent|infix).en_GB.isEqualIncludingScale\n/import ch.tutteli.atrium.api.$1.en_GB.toEqualIncludingScale\n/g;' \
-pe 's/([\. ])isEqualIncludingScale([\( ])/$1toEqualIncludingScale$2/g;' \
-pe 's/import ch.tutteli.atrium.api.(fluent|infix).en_GB.isNotEqualIncludingScale\n/import ch.tutteli.atrium.api.$1.en_GB.notToEqualIncludingScale\n/g;' \
-pe 's/([\. ])isNotEqualIncludingScale([\( ])/$1notToEqualIncludingScale$2/g;' \
-pe 's/import ch.tutteli.atrium.api.(fluent|infix).en_GB.isBefore\n/import ch.tutteli.atrium.api.$1.en_GB.toBeBefore\n/g;' \
-pe 's/([\. ])isBefore([\( ])/$1toBeBefore$2/g;' \
-pe 's/import ch.tutteli.atrium.api.(fluent|infix).en_GB.isBeforeOrEqual\n/import ch.tutteli.atrium.api.$1.en_GB.toBeBeforeOrTheSamePointInTimeAs\n/g;' \
-pe 's/([\. ])isBeforeOrEqual([\( ])/$1toBeBeforeOrTheSamePointInTimeAs$2/g;' \
-pe 's/import ch.tutteli.atrium.api.(fluent|infix).en_GB.isAfter\n/import ch.tutteli.atrium.api.$1.en_GB.toBeAfter\n/g;' \
-pe 's/([\. ])isAfter([\( ])/$1toBeAfter$2/g;' \
-pe 's/import ch.tutteli.atrium.api.(fluent|infix).en_GB.isAfterOrEqual\n/import ch.tutteli.atrium.api.$1.en_GB.toBeAfterOrTheSamePointInTimeAs\n/g;' \
-pe 's/([\. ])isAfterOrEqual([\( ])/$1toBeAfterOrTheSamePointInTimeAs$2/g;' \
-pe 's/import ch.tutteli.atrium.api.(fluent|infix).en_GB.isEqual\n/import ch.tutteli.atrium.api.$1.en_GB.toBeTheSamePointInTimeAs\n/g;' \
-pe 's/([\. ])isEqual([\( ])/$1toBeTheSamePointInTimeAs$2/g;' \
-pe 's/import ch.tutteli.atrium.api.fluent.en_GB.isPresent\n/import ch.tutteli.atrium.api.fluent.en_GB.toBePresent\n/g;' \
-pe 's/([\. ])isPresent\(/$1toBePresent\(/g;' \
-pe 's/import ch.tutteli.atrium.api.fluent.en_GB.isSuccess\n/import ch.tutteli.atrium.api.fluent.en_GB.toBeASuccess\n/g;' \
-pe 's/([\. ])isSuccess\(/$1toBeASuccess\(/g;' \
-pe 's/import ch.tutteli.atrium.api.infix.en_GB.success\n/import ch.tutteli.atrium.api.infix.en_GB.aSuccess\n/g;' \
-pe 's/toBe\(success\)/toBe\(aSuccess\)/g;' \
-pe 's/toBe success \{/toBe aSuccess \{/g;' \
-pe 's/import ch.tutteli.atrium.api.(fluent|infix).en_GB.isFailure\n/import ch.tutteli.atrium.api.$1.en_GB.toBeAFailure\n/g;' \
-pe 's/([\. ])isFailure([\( ])/$1toBeAFailure$2/g;' \
-pe 's/import ch.tutteli.atrium.api.fluent.en_GB.exists\n/import ch.tutteli.atrium.api.fluent.en_GB.toExist\n/g;' \
-pe 's/([\. ])exists\(/$1toExist\(/g;' \
-pe 's/import ch.tutteli.atrium.api.fluent.en_GB.existsNot\n/import ch.tutteli.atrium.api.fluent.en_GB.notToExist\n/g;' \
-pe 's/([\. ])existsNot\(/$1notToExist\(/g;' \
-pe 's/import ch.tutteli.atrium.api.fluent.en_GB.is(Readable|Writable|Executable|Absolute|Relative)\n/import ch.tutteli.atrium.api.fluent.en_GB.toBe$1\n/g;' \
-pe 's/([\. ])is(Readable|Writable|Executable|Absolute|Relative)\(/$1toBe$2\(/g;' \
-pe 's/import ch.tutteli.atrium.api.fluent.en_GB.is(RegularFile|Directory|SymbolicLink)\n/import ch.tutteli.atrium.api.fluent.en_GB.toBeA$1\n/g;' \
-pe 's/([\. ])is(RegularFile|Directory|SymbolicLink)\(/$1toBeA$2\(/g;' \
-pe 's/import ch.tutteli.atrium.api.fluent.en_GB.isEmptyDirectory\n/import ch.tutteli.atrium.api.fluent.en_GB.toBeAnEmptyDirectory\n/g;' \
-pe 's/([\. ])isEmptyDirectory\(/$1toBeAnEmptyDirectory\(/g;' \
-pe 's/import ch.tutteli.atrium.api.fluent.en_GB.hasDirectoryEntry\n/import ch.tutteli.atrium.api.fluent.en_GB.toHaveTheDirectoryEntries\n/g;' \
-pe 's/([\. ])hasDirectoryEntry\(/$1toHaveTheDirectoryEntries\(/g;' \
-pe 's/import ch.tutteli.atrium.api.fluent.en_GB.hasSameTextualContentAs\n/import ch.tutteli.atrium.api.fluent.en_GB.toHaveTheSameTextualContentAs\n/g;' \
-pe 's/([\. ])hasSameTextualContentAs\(/$1toHaveTheSameTextualContentAs\(/g;' \
-pe 's/import ch.tutteli.atrium.api.fluent.en_GB.hasSameBinaryContentAs\n/import ch.tutteli.atrium.api.fluent.en_GB.toHaveTheSameBinaryContentAs\n/g;' \
-pe 's/([\. ])hasSameBinaryContentAs\(/$1toHaveTheSameBinaryContentAs\(/g;'
It might well be that the above commands replace a bit too much in certain cirumstances (e.g. if you use Kotlin's all
, any
or none
in tests or startsWith
, endsWith
etc.) - we guess that reverting those cases is still faster than applying suggestions manually. Feel free to remove the corresponding problematic lines and use the replacements for those cases instead.
The above command does not include the replacement of hasNext
and hasNotNext
as the replacement is depending on the type of the subject of the assertion. Please use the suggested replacements in the @Deprecated
annotation.
Please have a look at older release-notes in case you don't migrate from 0.12.0 - 0.16.0
We would like to thank Tegonal GmbH for sponsoring Support and PR-Review time.
And also a big thank you for sponsoring some time to speed up the transition to the new to + infitive naming schema 🙃
Are you are using Atrium at work?
Please consider to support the project as well by:
Published by robstoll over 3 years ago
Official release notes will be done with v0.17.0 (see https://github.com/robstoll/atrium/wiki/Release-notes-0.17.0-draft in the meantime)
Published by robstoll over 3 years ago
its
as convenience feature extractor at the cost of poorer reportinghas duplicates
=> reports now has not: duplicate elements
because
=> thanks to @jGleitzBasically all assertion functions in api-fluent (and maybe also in api-infix) as we move to a consistent to + infinitive
naming schema in api-fluent. We might deprecate all translation enum entries which do not follow the to+infinitive schema but since we plan to rename those in 0.18.0 anyway, we might also wait until then.
Planned (previously deprecated or announced)
see #755
moreover:
Unplanned
First of all, see deprecation above which will be removed with 0.17.0, some of them are breaking as well
See atrium-roadmap -> Milestone 1.0.0
The following command is carrying out some search & replace so that you don't need to rely on the (unfortunately sometimes buggy) behaviour of ReplaceWith.
find ./ -path "*/test/*" -name "*.kt" | xargs perl -0777 -i \
-pe 's/import ch.tutteli.atrium.domain.builders.utils/import ch.tutteli.atrium.logic.utils/g;'
Please have a look at older release-notes in case you don't migrate from 0.12.0 - 0.15.0
We would like to thank Tegonal GmbH for sponsoring Support and PR-Review time.
Are you are using Atrium at work?
Please consider to support the project as well by:
Published by robstoll almost 4 years ago
Planned (previously deprecated or announced)
Unplanned
to + infinitive
syntax and will therefore deprecate most of the assertion functions, see https://github.com/robstoll/atrium-roadmap/issues/93 for more information.See atrium-roadmap -> Milestone 1.0.0
We provide @Deprecated
annotations with ReplaceWith
-> use the suggestions as advertised.
Please have a look at older release-notes in case you don't migrate from 0.12.0, 0.13.0 or 0.14.0
We would like to thank Tegonal GmbH for sponsoring Support and PR-Review time.
Are you are using Atrium at work?
Please consider to support the project as well by:
Published by robstoll almost 4 years ago
Planned (previously deprecated or announced)
Unplanned
asExpect
to turn an Assert<T>
into an Expect<T>
=> time to move on 😉See atrium-roadmap -> Milestone 1.0.0
We don't provide ReplaceWith
to transition from atrium-domain-robstoll/-robstoll-lib to atrium-logic in all cases. We don't expect that there are enough users using types of those modules directly. Let us know if you do and have troubles migrating.
In case you should use:
mapArguments
, then search for import ch.tutteli.atrium.domain.builders.utils.mapArguments
and replace it with import ch.tutteli.atrium.logic.utils.mapArguments
nullable
, then search for import ch.tutteli.atrium.domain.builders.utils.nullable
and replace with import ch.tutteli.atrium.logic.utils.nullable
subExpect
, then search for subExpect
and replace with expectLambda
and search for import ch.tutteli.atrium.domain.builders.utils.subExpect
and replace with import ch.tutteli.atrium.logic.utils.expectLambda
Some further search&replace patterns for assertion writers, in case you use:
CharSequenceOrNumberOrChar
or CharSequenceOrNumberOrChar
, search for import ch.tutteli.atrium.domain.creating.typeutils
and replace with import ch.tutteli.atrium.logic.creating.typeutils
In case you already started using the experimental atrium-logic module, then you might run into the problem that:
getExpectOfFeature()
does not exist => replace with transform()addToInitial
does not exist => replace with collectAndAppend
genericSubjectBasedFeature
and genericFeature
from FeatureAssertions -> use either manualFeature or FeatureExtractor/FeatureExtractorBuilder insteadPlease have a look at the older release-notes in case you don't migrate from 0.12.0 or 0.13.0
We would like to thank Tegonal GmbH for sponsoring Support and PR-Review time.
Are you are using Atrium at work?
Please consider to support the project as well by:
Published by robstoll about 4 years ago
Planned (previously deprecated or announced)
Unplanned
ch.tutteli.atrium.assertions.builders.Explanatory.ExplanationOption#withExplanation(ch.tutteli.atrium.reporting.translating.Translatable)
because Translatables are now treated as Text in any case -- this is a binary backward compatibility break, it should suffice to re-compile.ch.tutteli.atrium.domain.builders.creating.changers.FeatureExtractorBuilder.RepresentationInCaseOfFailureStep#withRepresentationForFailure(ch.tutteli.atrium.reporting.translating.Translatable)
for the same reasonpreviousExpect
and getAssertions()
from FeatureExpect => let me know in case you used itconfig
from RootExpect and FeatureExpectSee atrium-roadmap -> Milestone 1.0.0
There a few deprecations in this version (see above) --
use the ReplaceWith
provided in the @Depreacted
annotations.
Please have a look at the older release-notes in case you don't migrate from 0.12.0
We would like to thank Tegonal GmbH for sponsoring Support and PR-Review time as well as the extra hours to finish the open PRs which should made it into v0.13.0.
Are you are using Atrium at work?
Please consider to support the project as well by:
Published by robstoll over 4 years ago
API Maturity: Stable
Implementation Maturity: Almost Stable
There won't be any breaking changes in the API (assertion functions/builders) until v1.0.0 besides parameter name renaming and experimental features. But we want to progress as well and deprecate functionality in each version (e.g quite a lot with 0.7.0; please replace deprecated functionality until v1.0.0 where we will remove it).
However, we do not provide yet a stable API for the domain and core modules of Atrium -- it is almost stable, but there might be slight breaking changes which we want to introduce before v1.0.0. That is also the reason why we do not have yet established backward compatibility tests for domain/core. This might affect you if you write your own assertion functions. And it also affects you if you provide your own implementation for parts of Atrium.
Thanks to the following contributors to support the migration from cc-infix-en_GB to infix-en_GB:
kotlin 1.3 extensions
Planned (previously deprecated or announced)
-android
jar you can use the regular jvm artifact instead)Unplanned
The following was deprecated and will be removed with 1.0.0:
import ch.tutteli.atrium.api.fluent.en_GB.jdk8
replace with import ch.tutteli.atrium.api.fluent.en_GB
See atrium-roadmap -> Milestone 1.0.0
There aren't any deprecations in api-fluent-en_GB in this version and thus also no migration required if you update from 0.9.x, 0.10.0 or 0.11.0
In case you used the jdk8 extension: it was merged into the main artifact:
import ch.tutteli.atrium.api.fluent.en_GB.jdk8
and replace with import ch.tutteli.atrium.api.fluent.en_GB
You should migrate from api-cc-infix-en_GB to the new api-infix-en_GB (api-cc-infix-en_GB will be removed with 1.0.0)
In case you migrate from a version < 0.7.0 to this version, then please have a look at the migration guide given in the Release notes of v0.7.0 and v0.8.0 first.
Otherwise you can use the suggested replacements (ALT + Enter -> Replace with ...) or the search/replace patterns shown below (recommended, since faster).
Notice, that you don't have to migrate everything at once where asExpect
and asAssert
allow to switch between the old Assert
and the new Expect
world.
Ping us in the Atrium slack channel if you need help.
The following command is carrying out the points 1 to 14 as described below. The script for 15a or 15b follows afterwards (don't forget to do the manual points 16, 17, ...), run it from the root of your project, no guarantees that your system is capable of carrying it out. If not, you can use the manual steps described below.
find ./ -path "*/test/*" -name "*.kt" | xargs perl -0777 -i \
-pe 's/AssertImpl([\n\r\s]*)\.changeSubject\(([^\)\n]+)\)[\n\r\s]*\{[\n\r\s]*subject/ExpectImpl$1.changeSubject\($2\)$1.unreported \{ it/g;' \
-pe 's/AssertImpl([\n\r\s]*)\.changeSubject\(([^\)]+)\)/ExpectImpl$1.changeSubject\($2\).unreported/g;' \
-pe 's/AssertImpl([\n\r\s]*)\.builder([\n\r\s]*)\.createDescriptive\(([^,\n]+,[^\)]+\)[\n\r\s]*\{[\n\r\s]*)plant.subject/AssertImpl([\n\r\s]*)\.builder([\n\r\s]*)\.createDescriptive\(([^,\n]+,[^\)]+\)[\n\r\s]*\{[\n\r\s]*)plant.subject/g;' \
-pe 's/AssertImpl([\n\r\s]*)\.builder([\n\r\s]*)\.descriptive([\n\r\s]*).withTest(\(?[\n\r\s]*)\{([\n\r\s]*)plant.subject/AssertImpl$1.builder$2.descriptive$3.withTest\(plant\)$4\{$5it/g;' \
-pe 's/AssertImpl([\n\r\s]*)\.builder([\n\r\s]*)\.descriptive([\n\r\s]*).withTest(\(?[\n\r\s]*)\{([\n\r\s]*)subject/AssertImpl$1.builder$2.descriptive$3.withTest\(this\)$4\{$5it/g;' \
-pe 's/(\.| )((?:toThrow|isA)<.*>)\s*\{\s*\}/$1$2()/g;' \
-pe 's/notToBeNull\s*\{\s*\}/notToBe null/g;' \
-pe 's/fun <T\s*:\s*Any> ([^\(]+)\(subject:\s*T\)[\n\r\s]*=[\n\r\s]*AssertImpl[\n\r\s]*\.coreFactory[\n\r\s]*\.newReportingPlant\(([^,]+),[\n\r\s]*\{\s*subject\s*\}[\n\r\s]*,[\n\r\s]*reporter\)/fun <T> $1\(subject: T\): Expect<T> = \n ExpectBuilder.forSubject\(subject\)\n .withVerb\($2\)\n .withoutOptions\(\)\n .build\(\)/g;' \
-pe 's/fun <T\s*:\s*Any> ([^\(]+)\(subject:\s*T\s*,[\n\r\s]*assertionCreator: Assert<T>.\(\)\s*->\s*Unit\)[\n\r\s]*=[\n\r\s]*AssertImpl[\n\r\s]*\.coreFactory[\n\r\s]*\.newReportingPlantAndAddAssertionsCreatedBy\(([^,]+),[\n\r\s]*\{\s*subject\s*\}[\n\r\s]*,[\n\r\s]*reporter,[\n\r\s]*assertionCreator\)/fun <T> $1\(subject: T, assertionCreator: Expect<T>.\(\) -> Unit\): Expect<T> = \n $1(subject).addAssertionsCreatedBy(assertionCreator)/g;' \
-pe 's/(?:internal )?fun <T(?:\s*:\s*Any\?)?> ([^\(]+)\(subject:\s*T\)[\n\r\s]*=[\n\r\s]*AssertImpl[\n\r\s]*\.coreFactory[\n\r\s]*\.newReportingPlantNullable\(([^,]+),[\n\r\s]*\{\s*subject\s*\}[\n\r\s]*,[^\)]+\)//g;' \
-pe 's/import ch.tutteli.atrium.verbs\.(expect|assert|assertThat)/import ch.tutteli.atrium.api.verbs.$1/g;' \
-pe 's/AssertImpl/ExpectImpl/g;' \
-pe 's/fun Assert(?:ionPlant(?:Nullable)?)?<(.*)>\./fun <T: $1> Expect<T>\./g;' \
-pe 's/Assert(ionPlant(Nullable)?)?</Expect</g;' \
-pe 's/import ch\.tutteli\.atrium\.creating\.Assert(ionPlant(Nullable)?)?/import ch.tutteli.atrium.creating.Expect/g;' \
-pe 's/import ch.tutteli\.atrium\.api\.cc\.infix\.en_GB/import ch.tutteli.atrium.api.infix.en_GB/g;' \
-pe 's/is(Less|Greater)OrEquals/is$1ThanOrEqual/g;' \
-pe 's/\.asIterable\(\)/ asList o/g;' \
-pe 's/asIterable(\s*\{)/asList$1/g;' \
-pe 's/\.asEntries\(\)/ asEntries o/g;' \
-pe 's/ o / it /g;' \
-pe 's/get\s*Index\(([^\)]+)\)\s*assertIt\s*\{([^\}]+)\}/get index($1) {$2}/g;' \
-pe 's/import ch.tutteli.atrium.api.infix.en_GB.Index/import ch.tutteli.atrium.api.infix.en_GB.index/g;' \
-pe 's/getExisting\s*Key\(([^\)]+)\)\s*assertIt\s*\{([^\}]+)\}/getExisting key($1) {$2}/g;' \
-pe 's/import ch.tutteli.atrium.api.infix.en_GB.Key/import ch.tutteli.atrium.api.infix.en_GB.key/g;'
In case you use Kotlin 1.4 or have enabled the new type inference, then you can use the following script to carry out point 13a:
find ./ -path "*/test/*" -name "*.kt" | xargs perl -0777 -i \
-pe 's/((?:[\n\r]+|\{)\s*)(?:property|returnValueOf|rueckgabewertVon)\((?:[\n\r\s]*)subject::([^\)]+)\)(\s*\{)/$1its feature of(\{ f(it::$2) \})$3/g;' \
-pe 's/(?:property|returnValueOf|rueckgabewertVon)\((?:[\n\r\s]*)subject::([^\)]+)\)(\s*\{)/feature of(\{ f(it::$1) \})$2/g;' \
-pe 's/((?:[\n\r]+|\{)\s*)(?:property|returnValueOf|rueckgabewertVon)\((?:[\n\r\s]*)subject::([^\)]+)\)/$1its feature \{ f(it::$2) \}/g;' \
-pe 's/(?:property|returnValueOf|rueckgabewertVon)\((?:[\n\r\s]*)subject::([^\)]+)\)/feature \{ f(it::$1) \}/g;' \
-pe 's/((?:[\n\r]+|\{)\s*)(?:property|returnValueOf|rueckgabewertVon)\(([A-Z][^:]+)::([^\)]+)\)(\s*\{)/$1its feature of($2::$3)$4/g;' \
-pe 's/(?:property|returnValueOf|rueckgabewertVon)\(([A-Z][^:]+)::([^\)]+)\)(\s*\{)/feature of($1::$2)$3/g;' \
-pe 's/((?:[\n\r]+|\{)\s*)(?:property|returnValueOf|rueckgabewertVon)\(([A-Z][^:]+)::([^\),]+)\)/$1 its feature($2::$3)/g;' \
-pe 's/(?:property|returnValueOf|rueckgabewertVon)\(([A-Z][^:]+)::([^\),]+)\)/feature($1::$2)/g;' \
-pe 's/((?:[\n\r]+|\{)\s*)(?:property|returnValueOf|rueckgabewertVon)\(([A-Z][^:]+)::([^\)]+)\)/$1its feature of($2::$3)/g;' \
-pe 's/(?:property|returnValueOf|rueckgabewertVon)\(([A-Z][^:]+)::([^\)]+)\)/feature of($1::$2)/g;' \
-pe 's/((?:[\n\r]+|\{)\s*)(?:property|returnValueOf|rueckgabewertVon)\(([^:]+)::([^\)]+)\)/$1its feature of("$2.$3") { $2.$3 }/g;' \
-pe 's/(?:property|returnValueOf|rueckgabewertVon)\(([^:]+)::([^\)]+)\)/feature("$1.$2", { $1.$2 })/g;' \
-pe 's/(import ch\.tutteli\.atrium\.api\.cc\.(?:\.infix)?(?:en_GB|de_CH))\.(property|returnValueOf)/$1.feature/g;' \
Otherwise you need to carry out the point 13b which can be done with the following script`
find ./ -path "*/test/*" -name "*.kt" | xargs perl -0777 -i \
-pe 's/((?:[\n\r]+|\{)\s*)(?:property|returnValueOf|rueckgabewertVon)\((?:[\n\r\s]*)subject::([^\)]+)\)(\s*\{)/$1its feature \{ f(it::$2) \} it$3/g;' \
-pe 's/(?:property|returnValueOf|rueckgabewertVon)\((?:[\n\r\s]*)subject::([^\)]+)\)(\s*\{)/feature \{ f(it::$1) \} it$2/g;' \
-pe 's/((?:[\n\r]+|\{)\s*)(?:property|returnValueOf|rueckgabewertVon)\((?:[\n\r\s]*)subject::([^\)]+)\)/$1its feature \{ f(it::$2) \}/g;' \
-pe 's/(?:property|returnValueOf|rueckgabewertVon)\((?:[\n\r\s]*)subject::([^\)]+)\)/feature \{ f(it::$1) \}/g;' \
-pe 's/((?:[\n\r]+|\{)\s*)(?:property|returnValueOf|rueckgabewertVon)\(([A-Z][^:]+)::([^\)]+)\)(\s*\{)/$1its feature of($2::$3)$4/g;' \
-pe 's/(?:property|returnValueOf|rueckgabewertVon)\(([A-Z][^:]+)::([^\)]+)\)(\s*\{)/feature of($1::$2)$3/g;' \
-pe 's/((?:[\n\r]+|\{)\s*)(?:property|returnValueOf|rueckgabewertVon)\(([A-Z][^:]+)::([^\),]+)\)/$1 its feature($2::$3)/g;' \
-pe 's/(?:property|returnValueOf|rueckgabewertVon)\(([A-Z][^:]+)::([^\),]+)\)/feature($1::$2)/g;' \
-pe 's/((?:[\n\r]+|\{)\s*)(?:property|returnValueOf|rueckgabewertVon)\(([A-Z][^:]+)::([^\)]+)\)/$1its feature of($2::$3)/g;' \
-pe 's/(?:property|returnValueOf|rueckgabewertVon)\(([A-Z][^:]+)::([^\)]+)\)/feature of($1::$2)/g;' \
-pe 's/((?:[\n\r]+|\{)\s*)(?:property|returnValueOf|rueckgabewertVon)\(([^:]+)::([^\)]+)\)/$1its feature of("$2.$3") { $2.$3 }/g;' \
-pe 's/(?:property|returnValueOf|rueckgabewertVon)\(([^:]+)::([^\)]+)\)/feature("$1.$2", { $1.$2 })/g;' \
-pe 's/(import ch\.tutteli\.atrium\.api\.cc\.(?:\.infix)?(?:en_GB|de_CH))\.(property|returnValueOf)/$1.feature/g;'
But you still need to add manually import ch.tutteli.atrium.api.infix.en_GB.workaround.it
where it
is not known
In case you cannot carry out the commands above, then read on to perform the manual steps:
The following list helps you to migrate faster by using a few regex search replace commands (in Intellij). Make sure you have checked Regex
as well as Match Case
in the search options. Notice, that the code will certainly not compile after a single replace, you need to carry out all search&replace commands.
It is not perfect, maybe you need to do a few adjustments in addition, let us now and we improve the search/replace commands here.
Switch to ExpectImpl.changeSubject instead of using AssertImpl.changeSubject:
Search: AssertImpl([\n\r\s]*)\.changeSubject\(([^\)\n]+)\)[\n\r\s]*\{[\n\r\s]*subject
Replace: ExpectImpl$1.changeSubject\($2\)$1.unreported { it
Search: AssertImpl([\n\r\s]*)\.changeSubject\(([^\)]+)\)
Replace: ExpectImpl$1.changeSubject\($2\).unreported
builder.descriptive, safe withTest
Search: AssertImpl([\n\r\s]*)\.builder([\n\r\s]*)\.createDescriptive\(([^,\n]+,[^\)]+\)[\n\r\s]*\{[\n\r\s]*)plant.subject
Replace: AssertImpl$1.builder$2.createDescriptive\(plant, $3it
Search: AssertImpl([\n\r\s]*)\.builder([\n\r\s]*)\.descriptive([\n\r\s]*).withTest(\(?[\n\r\s]*)\{([\n\r\s]*)plant.subject
Replace: AssertImpl$1.builder$2.descriptive$3.withTest\(plant\)$4{$5it
Search: AssertImpl([\n\r\s]*)\.builder([\n\r\s]*)\.descriptive([\n\r\s]*).withTest(\(?[\n\r\s]*)\{([\n\r\s]*)subject
Replace: AssertImpl$1.builder$2.descriptive$3.withTest\(this\)$4{$5it
toThrow and isA with empty assertionCreator lambda
Search: (\.| )((?:toThrow|wirft|isA|istEin)<.*>)\s*\{\s*\}
Replace $1$2()
notToBeNull with empty assertionCreator lambda
Search: notToBeNull\s*\{\s*\}
Replace: notToBe null
migrate custom assertion verbs:
Search: fun <T\s*:\s*Any> ([^\(]+)\(subject:\s*T\)[\n\r\s]*=[\n\r\s]*AssertImpl[\n\r\s]*\.coreFactory[\n\r\s]*\.newReportingPlant\(([^,]+),[\n\r\s]*\{\s*subject\s*\}[\n\r\s]*,[\n\r\s]*reporter\)
Replace:
fun <T> $1\(subject: T\): Expect<T> = \n ExpectBuilder.forSubject\(subject\)\n .withVerb\($2\)\n .withoutOptions\(\)\n .build\(\)
Search:
fun <T\s*:\s*Any> ([^\(]+)\(subject:\s*T\s*,[\n\r\s]*assertionCreator: Assert<T>.\(\)\s*->\s*Unit\)[\n\r\s]*=[\n\r\s]*AssertImpl[\n\r\s]*\.coreFactory[\n\r\s]*\.newReportingPlantAndAddAssertionsCreatedBy\(([^,]+),[\n\r\s]*\{\s*subject\s*\}[\n\r\s]*,[\n\r\s]*reporter,[\n\r\s]*assertionCreator\)
Replace:
fun <T> $1\(subject: T, assertionCreator: Expect<T>.\(\) -> Unit\): Expect<T> = \n $1(subject).addAssertionsCreatedBy(assertionCreator)
Search:
(?:internal )?fun <T(?:\s*:\s*Any\?)?> ([^\(]+)\(subject:\s*T\)[\n\r\s]*=[\n\r\s]*AssertImpl[\n\r\s]*\.coreFactory[\n\r\s]*\.newReportingPlantNullable\(([^,]+),[\n\r\s]*\{\s*subject\s*\}[\n\r\s]*,[^\)]+\)
Replace:
(empty string)
In case the above search&replace did not find anything (because your code is different):
Switch from AssertImpl.coreFactory.newReportingPlant
to ExpectBuilder
=> see atriumVerbs.kt for an example of how own assertion verbs are defined now; or use the suggested replacements but please add import ch.tutteli.atrium.domain.builders.reporting.ExpectBuilder
first as it will not work correctly otherwise due to an Intellij bug
=> Note that you don't need a verb for nullable types any more. Thus:
T: Any
act: () -> Unit
Switch to new built-in assertion verbs which use Expect
Search: import ch.tutteli.atrium.verbs.(expect|assert|assertThat)
Replace: import ch.tutteli.atrium.api.verbs.$1
Switch from AssertImpl to ExpectImpl
Search: AssertImpl
Replace: ExpectImpl
Switch all your assertion functions to use Expect and no longer Assert:
Search: import ch\.tutteli\.atrium\.creating\.Assert(ionPlant(Nullable)?)?
Replace: import ch.tutteli.atrium.creating.Expect
Search: fun Assert(?:ionPlant(?:Nullable)?)?<(.*)>\.
Replace: fun <T: $1> Expect<T>\.
Search: Assert(ionPlant(Nullable)?)?<
Replace: Expect<
Switch the API
Search: import ch.tutteli\.atrium\.api\.cc\.infix\.en_GB Replace:
import ch.tutteli.atrium.api.infix`
isLessOr/isGreaterOrEquals
Search: is(Less|Greater)OrEquals
Replace: is$1ThanOrEqual
11 use asList instead of asIterable and replace asEntries()
Search: \.asIterable\(\)
Replace: asList o
Search: asIterable(\s*\{)
Replace: asList$1
Search: asEntries\(\)
Replace: asEntries o
12 List get Index assertIt
This one has to be done with care as there could be nested assertion group blocks
Search: get\s*Index\(([^\)]+)\)\s*assertIt\s*\{([^\}]+)\}
Replace: get index($1) {$2}
Search: import ch.tutteli.atrium.api.infix.en_GB.Index
Replace: import ch.tutteli.atrium.api.infix.en_GB.index
13 Map getExisting Key assertIt
This one has to be done with care as there could be nested assertion group blocks
Search: getExisting\s*Key\(([^\)]+)\)\s*assertIt\s*\{([^\}]+)\}
Replace: getExisting key($1) {$2}
Search: import ch.tutteli.atrium.api.infix.en_GB.Key
Replace: import ch.tutteli.atrium.api.infix.en_GB.key
14 use it
instead of o
inside assertion groups:
Search: o
Replace: it
(you can also replace by its
)
15a. use new feature mechanism - replacements for Kotlin 1.4 or the new inference (skip to 13b in case you use Kotlin < 1.4)
This one needs extra care as arguments could be function calls. Verify the replacements
Search: ((?:[\n\r]+|\{)\s*)(?:property|returnValueOf|rueckgabewertVon)\((?:[\n\r\s]*)subject::([^\)]+)\)(\s*\{)
Replace: $1its feature of(\{ f(it::$2) \})$3
Search: (?:property|returnValueOf|rueckgabewertVon)\((?:[\n\r\s]*)subject::([^\)]+)\)(\s*\{)
Replace: feature of(\{ f(it::$1) \})$2
Search: ((?:[\n\r]+|\{)\s*)(?:property|returnValueOf|rueckgabewertVon)\((?:[\n\r\s]*)subject::([^\)]+)\)
Replace: $1its feature \{ f(it::$2) \}
Search: (?:property|returnValueOf|rueckgabewertVon)\((?:[\n\r\s]*)subject::([^\)]+)\)
Replace: feature \{ f(it::$1) \}
Search: ((?:[\n\r]+|\{)\s*)(?:property|returnValueOf|rueckgabewertVon)\(([A-Z][^:]+)::([^\)]+)\)(\s*\{)
Replace: $1its feature of($2::$3)$4
Search: (?:property|returnValueOf|rueckgabewertVon)\(([A-Z][^:]+)::([^\)]+)\)(\s*\{)
Replace: feature of($1::$2)$3
Search: ((?:[\n\r]+|\{)\s*)(?:property|returnValueOf|rueckgabewertVon)\(([A-Z][^:]+)::([^\),]+)\)
Replace: $1 its feature($2::$3)
Search: (?:property|returnValueOf|rueckgabewertVon)\(([A-Z][^:]+)::([^\),]+)\)
Replace: feature($1::$2)
Search: ((?:[\n\r]+|\{)\s*)(?:property|returnValueOf|rueckgabewertVon)\(([A-Z][^:]+)::([^\)]+)\)
Replace: $1its feature of($2::$3)
Search: (?:property|returnValueOf|rueckgabewertVon)\(([A-Z][^:]+)::([^\)]+)\)
Replace: feature of($1::$2)
Search: ((?:[\n\r]+|\{)\s*)(?:property|returnValueOf|rueckgabewertVon)\(([^:]+)::([^\)]+)\)
Replace: $1its feature of("$2.$3") { $2.$3 }
Search: (?:property|returnValueOf|rueckgabewertVon)\(([^:]+)::([^\)]+)\)
Replace: feature("$1.$2", { $1.$2 })
Search: (import ch\.tutteli\.atrium\.api\.cc\.(?:\.infix)?(?:en_GB|de_CH))\.(property|returnValueOf)
Replace: $1.feature
15b use new feature mechanism - replacements for Kotlin < 1.4 (skip if you already applied 11a)
This one needs extra care as arguments could be function calls. Verify the replacements
Search: ((?:[\n\r]+|\{)\s*)(?:property|returnValueOf|rueckgabewertVon)\((?:[\n\r\s]*)subject::([^\)]+)\)(\s*\{)
add import ch.tutteli.atrium.api.infix.en_GB.workaround.it
to those files
Search again for: ((?:[\n\r]+|\{)\s*)(?:property|returnValueOf|rueckgabewertVon)\((?:[\n\r\s]*)subject::([^\)]+)\)(\s*\{)
Replace: $1its feature \{ f(it::$2) \} it$3
Search: (?:property|returnValueOf|rueckgabewertVon)\((?:[\n\r\s]*)subject::([^\)]+)\)(\s*\{)
Replace: feature \{ f(it::$1) \} it$2
Search: ((?:[\n\r]+|\{)\s*)(?:property|returnValueOf|rueckgabewertVon)\((?:[\n\r\s]*)subject::([^\)]+)\)
Replace: $1its feature \{ f(it::$2) \}
Search: (?:property|returnValueOf|rueckgabewertVon)\((?:[\n\r\s]*)subject::([^\)]+)\)
Replace: feature \{ f(it::$1) \}
Search: ((?:[\n\r]+|\{)\s*)(?:property|returnValueOf|rueckgabewertVon)\(([A-Z][^:]+)::([^\)]+)\)(\s*\{)
Replace: $1its feature of($2::$3)$4
Search: (?:property|returnValueOf|rueckgabewertVon)\(([A-Z][^:]+)::([^\)]+)\)(\s*\{)
Replace: feature of($1::$2)$3
Search: ((?:[\n\r]+|\{)\s*)(?:property|returnValueOf|rueckgabewertVon)\(([A-Z][^:]+)::([^\),]+)\)
Replace: $1 its feature($2::$3)
Search: (?:property|returnValueOf|rueckgabewertVon)\(([A-Z][^:]+)::([^\),]+)\)
Replace: feature($1::$2)
Search: ((?:[\n\r]+|\{)\s*)(?:property|returnValueOf|rueckgabewertVon)\(([A-Z][^:]+)::([^\)]+)\)
Replace: $1its feature of($2::$3)
Search: (?:property|returnValueOf|rueckgabewertVon)\(([A-Z][^:]+)::([^\)]+)\)
Replace: feature of($1::$2)
Search: ((?:[\n\r]+|\{)\s*)(?:property|returnValueOf|rueckgabewertVon)\(([^:]+)::([^\)]+)\)
Replace: $1its feature of("$2.$3") { $2.$3 }
Search: (?:property|returnValueOf|rueckgabewertVon)\(([^:]+)::([^\)]+)\)
Replace: feature("$1.$2", { $1.$2 })
Search: (import ch\.tutteli\.atrium\.api\.cc\.(?:\.infix)?(?:en_GB|de_CH))\.(property|returnValueOf)
Replace: $1.feature
But you still need to add manually import ch.tutteli.atrium.api.infix.en_GB.workaround.it
where it
is not known
16 In case you have custom assertion verbs
Dealing with thrown exceptions is now handled by Expect
as well.
However, in case you have named the assertion verb differently for expecting an Exception then you have to decide:
act: () -> Unit
to the same name and remove it afterwardsact: () -> Unit
to the other verbCheck if you need to add import ch.tutteli.atrium.domain.builders.reporting.ExpectBuilder
Try to reduce duplicated Expect imports
Repeat until you don't have duplicate imports any more
Search: import ch\.tutteli\.atrium\.creating\.Expect\n\s*import ch\.tutteli\.atrium\.creating\.Expect
Replace: import ch.tutteli.atrium.creating.Expect
Try to compile your project and watch out for the following warnings:
'MyClass' is a final type, and thus a value of the type parameter is predetermined
@file:Suppress("FINAL_UPPER_BOUND")
to your file, this is actually a Kotlin bug (https://youtrack.jetbrains.com/issue/KT-34257)Published by robstoll over 4 years ago
See #485 for more details. All other features introduce in v0.11.0 are shown in release notes of v0.11.0
Published by robstoll over 4 years ago
API Maturity: Stable
Implementation Maturity: Almost Stable
There won't be any breaking changes in the API (assertion functions/builders) until v1.0.0 besides parameter name renaming and experimental features. But we want to progress as well and deprecate functionality in each version (e.g quite a lot with 0.7.0 and with 0.9.0; please replace deprecated functionality until v1.0.0 where we will remove it).
However, we do not provide yet a stable API for the domain and core modules of Atrium -- it is almost stable, but there might be slight breaking changes which we want to introduce before v1.0.0. That is also the reason why we do not have yet established backward compatibility tests for domain/core. This might affect you if you write your own assertion functions. And it also affects you if you provide your own implementation for parts of Atrium.
Planned (previously deprecated or announced)
Unplanned
See atrium-roadmap -> Milestone 1.0.0
There aren't any deprecations in this version and thus also no migration required if you update from 0.9.x or 0.10.0.
In case you migrate from 0.8.0 to this version, have a look at the migration guide given in the release notes of v0.9.0
Published by robstoll over 4 years ago
API Maturity: Stable
Implementation Maturity: Almost Stable
There won't be any breaking changes in the API (assertion functions/builders) until v1.0.0 besides parameter name renaming and experimental features. But we want to progress as well and deprecate functionality in each version (e.g quite a lot with 0.7.0; please replace deprecated functionality until v1.0.0 where we will remove it).
However, we do not provide yet a stable API for the domain and core modules of Atrium -- it is almost stable, but there might be slight breaking changes which we want to introduce before v1.0.0. That is also the reason why we do not have yet established backward compatibility tests for domain/core. This might affect you if you write your own assertion functions. And it also affects you if you provide your own implementation for parts of Atrium.
jdk8 extensions
Planned (previously deprecated or announced)
Unplanned
See atrium-roadmap -> Milestone 1.0.0
There aren't any deprecations in this version and thus also no migration required if you update from 0.9.0.
In case you migrate from 0.8.0 to this version, have a look at the migration guide given in the release notes of v0.9.0
Published by robstoll over 4 years ago
it was planned that withOptions
ships with 0.9.0 (see #153). However, this was done only for the assertion verb which is used internally in Atrium but was not revealed for the predefined assertion verbs, hence this patch-version (thanks to @matejdro for the report - #362)
Most users won't use withOptions
and thus we are going to present only withRepresentation
for now (introduced in 0.9.2 #365).
❗❗Note though that withOptions
and withRepresentation
are both experimental and might be changed in a future version without previous notice nor migration path.
withRepresentation
can be used as follows :
expect(listOf(1,2,2,3 /* imagine a lot more numbers */))
.withRepresentation("xy numbers")
.all { isLessThan(10) }
The error report looks then as follows in case of a failure:
expected that subject: xy numbers
◆ all entries:
» is less than: 10 (kotlin.Int <1234789>)
❗❗ following entries were mismatched:
⚬ index 101: 12 (kotlin.Int <8933389>)
⚬ index 223: 10 (kotlin.Int <4523459>)
To use it, you have to add the following annotation to your test method/class @UseExperimental(ExperimentalWithOptions::class)
all other features as well a migration guide is given in the release notes of v0.9.0
Published by robstoll over 4 years ago
all other features as well a migration guide is given in the release notes of v0.9.0
Published by robstoll over 4 years ago
API Maturity: Stable
Implementation Maturity: Almost Stable
There won't be any breaking changes in the API (assertion functions/builders) until v1.0.0 besides parameter name renaming and experimental features. But we want to progress as well and deprecate functionality in each version (e.g quite a lot with 0.7.0; please replace deprecated functionality until v1.0.0 where we will remove it).
However, we do not provide yet a stable API for the domain and core modules of Atrium -- it is almost stable, but there might be slight breaking changes which we want to introduce before v1.0.0. That is also the reason why we do not have yet established backward compatibility tests for domain/core. This might affect you if you write your own assertion functions. And it also affects you if you provide your own implementation for parts of Atrium.
Expect<T>
as replacement for Assert<out T>
=> things like expect(1).toBe("not an int")
result now in a compile errorjdk8 extensions
kotlin 1.3 extensions
Features for assertion-function-writers:
assertionCreator
-lambdaExpectImpl.feature.extractor
ExpectImpl.builder.representationOnly
=> assertion without description but only a representationimplement
instead of compile
in build.gradle where possible => thanks to @kssc0112 for the implementationnumber of occurrences
=> thanks to @Jak-Sidious for the implementationequals
=> thanks to @Hubisco for the implementationPlanned (previously deprecated or announced)
Unplanned
The following was deprecated and will be removed with 1.0.0:
Assert/AssertionPlant
and the like => switch to Expect
and the likecreateAndAddAssertion(TO_BE, expected) { subject == expected }
one has to write createAndAddAssertion(TO_BE, expected) { it == expected }
The following deprecations are planned for a future version
Expect
as soon as the new infix API is ready.See atrium-roadmap -> Milestone 1.0.0
In case you migrate from a version < 0.7.0 then please have a look at the migration guide given in the Release Notes of 0.7.0 and 0.8.0.
Otherwise you can use the suggested replacements (ALT + Enter -> Replace with ...) or the search/replace patterns shown below.
Notice, that you don't have to migrate everything at once where asExpect
and asAssert
allow to switch between the old Assert
and the new Expect
world.
Ping us in the Atrium slack channel if you need help.
The following command is carrying out the points 1 to 11 described below (don't forget the points 12, 13, ...), run it from the root of your project, no guarantees that your system is capable of carrying it out. If not, you can use the manual steps described below
find ./ -path "*/test/*" -name "*.kt" | xargs perl -0777 -i \
-pe 's/AssertImpl([\n\r\s]*)\.changeSubject\(([^\)\n]+)\)[\n\r\s]*\{[\n\r\s]*subject/ExpectImpl$1.changeSubject\($2\)$1.unreported \{ it/g;' \
-pe 's/AssertImpl([\n\r\s]*)\.changeSubject\(([^\)]+)\)/ExpectImpl$1.changeSubject\($2\).unreported/g;' \
-pe 's/AssertImpl([\n\r\s]*)\.builder([\n\r\s]*)\.createDescriptive\(([^,\n]+,[^\)]+\)[\n\r\s]*\{[\n\r\s]*)plant.subject/AssertImpl([\n\r\s]*)\.builder([\n\r\s]*)\.createDescriptive\(([^,\n]+,[^\)]+\)[\n\r\s]*\{[\n\r\s]*)plant.subject/g;' \
-pe 's/AssertImpl([\n\r\s]*)\.builder([\n\r\s]*)\.descriptive([\n\r\s]*).withTest(\(?[\n\r\s]*)\{([\n\r\s]*)plant.subject/AssertImpl$1.builder$2.descriptive$3.withTest\(plant\)$4\{$5it/g;' \
-pe 's/AssertImpl([\n\r\s]*)\.builder([\n\r\s]*)\.descriptive([\n\r\s]*).withTest(\(?[\n\r\s]*)\{([\n\r\s]*)subject/AssertImpl$1.builder$2.descriptive$3.withTest\(this\)$4\{$5it/g;' \
-pe 's/(?:property|returnValueOf|rueckgabewertVon)\((?:[\n\r\s]*)subject::([^\)]+)\)(\s*\{)/feature(\{ f(it::$1) \})$2/g;' \
-pe 's/(?:property|returnValueOf|rueckgabewertVon)\((?:[\n\r\s]*)subject::([^\)]+)\)/feature \{ f(it::$1) \}/g;' \
-pe 's/(?:property|returnValueOf|rueckgabewertVon)\((?:[\n\r\s]*)subject::([^\)]+)\)(\s*\{)`/feature(\{ f(it::$1) \})$2/g;' \
-pe 's/(?:property|returnValueOf|rueckgabewertVon)\(([A-Z][^:]+)::([^\)]+)\)/feature($1::$2)/g;' \
-pe 's/(?:property|returnValueOf|rueckgabewertVon)\(([^:]+)::([^\)]+)\)/feature("$1.$2", { $1.$2 })/g;' \
-pe 's/(import ch\.tutteli\.atrium\.api\.cc\.(?:\.infix)?(?:en_GB|de_CH))\.(property|returnValueOf)/$1.feature/g;' \
-pe 's/(\.| )((?:toThrow|wirft|isA|istEin)<.*>)\s*\{\s*\}/$1$2()/g;' \
-pe 's/notToBeNull\s*\{\s*\}/notToBe(null)/g;' \
-pe 's/fun <T\s*:\s*Any> ([^\(]+)\(subject:\s*T\)[\n\r\s]*=[\n\r\s]*AssertImpl[\n\r\s]*\.coreFactory[\n\r\s]*\.newReportingPlant\(([^,]+),[\n\r\s]*\{\s*subject\s*\}[\n\r\s]*,[\n\r\s]*reporter\)/fun <T> $1\(subject: T\): Expect<T> = \n ExpectBuilder.forSubject\(subject\)\n .withVerb\($2\)\n .withoutOptions\(\)\n .build\(\)/g;' \
-pe 's/fun <T\s*:\s*Any> ([^\(]+)\(subject:\s*T\s*,[\n\r\s]*assertionCreator: Assert<T>.\(\)\s*->\s*Unit\)[\n\r\s]*=[\n\r\s]*AssertImpl[\n\r\s]*\.coreFactory[\n\r\s]*\.newReportingPlantAndAddAssertionsCreatedBy\(([^,]+),[\n\r\s]*\{\s*subject\s*\}[\n\r\s]*,[\n\r\s]*reporter,[\n\r\s]*assertionCreator\)/fun <T> $1\(subject: T, assertionCreator: Expect<T>.\(\) -> Unit\): Expect<T> = \n $1(subject).addAssertionsCreatedBy(assertionCreator)/g;' \
-pe 's/(?:internal )?fun <T(?:\s*:\s*Any\?)?> ([^\(]+)\(subject:\s*T\)[\n\r\s]*=[\n\r\s]*AssertImpl[\n\r\s]*\.coreFactory[\n\r\s]*\.newReportingPlantNullable\(([^,]+),[\n\r\s]*\{\s*subject\s*\}[\n\r\s]*,[^\)]+\)//g;' \
-pe 's/import ch.tutteli.atrium.verbs\.(expect|assert|assertThat)/import ch.tutteli.atrium.api.verbs.$1/g;' \
-pe 's/AssertImpl/ExpectImpl/g;' \
-pe 's/fun Assert(?:ionPlant(?:Nullable)?)?<(.*)>\./fun <T: $1> Expect<T>\./g;' \
-pe 's/Assert(ionPlant(Nullable)?)?</Expect</g;' \
-pe 's/import ch\.tutteli\.atrium\.creating\.Assert(ionPlant(Nullable)?)?/import ch.tutteli.atrium.creating.Expect/g;' \
-pe 's/import ch.tutteli\.atrium\.api\.cc\.(en_GB|de_CH)/import ch.tutteli.atrium.api.fluent.$1/g;' \
-pe 's/is(Less|Greater)OrEquals/is$1ThanOrEqual/g;'
The following list helps you to migrate faster by using a few regex search replace commands (in Intellij). Make sure you have checked Regex
as well as Match Case
in the search options. Notice, that the code will certainly not compile after a single replace, you need to carry out all search&replace commands.
It is not perfect, maybe you need to do a few adjustments in addition, let us now and we improve the search/replace commands here.
Switch to ExpectImpl.changeSubject instead of using AssertImpl.changeSubject:
Search: AssertImpl([\n\r\s]*)\.changeSubject\(([^\)\n]+)\)[\n\r\s]*\{[\n\r\s]*subject
Replace: ExpectImpl$1.changeSubject\($2\)$1.unreported { it
Search: AssertImpl([\n\r\s]*)\.changeSubject\(([^\)]+)\)
Replace: ExpectImpl$1.changeSubject\($2\).unreported
builder.descriptive, safe withTest
Search: AssertImpl([\n\r\s]*)\.builder([\n\r\s]*)\.createDescriptive\(([^,\n]+,[^\)]+\)[\n\r\s]*\{[\n\r\s]*)plant.subject
Replace: AssertImpl$1.builder$2.createDescriptive\(plant, $3it
Search: AssertImpl([\n\r\s]*)\.builder([\n\r\s]*)\.descriptive([\n\r\s]*).withTest(\(?[\n\r\s]*)\{([\n\r\s]*)plant.subject
Replace: AssertImpl$1.builder$2.descriptive$3.withTest\(plant\)$4{$5it
Search: AssertImpl([\n\r\s]*)\.builder([\n\r\s]*)\.descriptive([\n\r\s]*).withTest(\(?[\n\r\s]*)\{([\n\r\s]*)subject
Replace: AssertImpl$1.builder$2.descriptive$3.withTest\(this\)$4{$5it
use new feature mechanism
This one needs extra care as arguments could be function calls. Verify the replacements
Search: (?:property|returnValueOf|rueckgabewertVon)\((?:[\n\r\s]*)subject::([^\)]+)\)(\s*\{)
Replace: feature(\{ f(it::$1) \})$2
Search: (?:property|returnValueOf|rueckgabewertVon)\((?:[\n\r\s]*)subject::([^\)]+)\)
Replace: feature \{ f(it::$1) \}
Search: (?:property|returnValueOf|rueckgabewertVon)\(([A-Z][^:]+)::([^\)]+)\)
Replace: feature($1::$2)
Search: (?:property|returnValueOf|rueckgabewertVon)\(([^:]+)::([^\)]+)\)
Replace: feature("$1.$2", { $1.$2 })
Search: (import ch\.tutteli\.atrium\.api\.cc\.(?:\.infix)?(?:en_GB|de_CH))\.(property|returnValueOf)
Replace: $1.feature
toThrow and isA with empty assertionCreator lambda
Search: (\.| )((?:toThrow|wirft|isA|istEin)<.*>)\s*\{\s*\}
Replace $1$2()
notToBeNull with empty assertionCreator lambda
Search: notToBeNull\s*\{\s*\}
Replace: notToBe(null)
migrate custom assertion verbs:
Search: fun <T\s*:\s*Any> ([^\(]+)\(subject:\s*T\)[\n\r\s]*=[\n\r\s]*AssertImpl[\n\r\s]*\.coreFactory[\n\r\s]*\.newReportingPlant\(([^,]+),[\n\r\s]*\{\s*subject\s*\}[\n\r\s]*,[\n\r\s]*reporter\)
Replace:
fun <T> $1\(subject: T\): Expect<T> = \n ExpectBuilder.forSubject\(subject\)\n .withVerb\($2\)\n .withoutOptions\(\)\n .build\(\)
Search:
fun <T\s*:\s*Any> ([^\(]+)\(subject:\s*T\s*,[\n\r\s]*assertionCreator: Assert<T>.\(\)\s*->\s*Unit\)[\n\r\s]*=[\n\r\s]*AssertImpl[\n\r\s]*\.coreFactory[\n\r\s]*\.newReportingPlantAndAddAssertionsCreatedBy\(([^,]+),[\n\r\s]*\{\s*subject\s*\}[\n\r\s]*,[\n\r\s]*reporter,[\n\r\s]*assertionCreator\)
Replace:
fun <T> $1\(subject: T, assertionCreator: Expect<T>.\(\) -> Unit\): Expect<T> = \n $1(subject).addAssertionsCreatedBy(assertionCreator)
Search:
(?:internal )?fun <T(?:\s*:\s*Any\?)?> ([^\(]+)\(subject:\s*T\)[\n\r\s]*=[\n\r\s]*AssertImpl[\n\r\s]*\.coreFactory[\n\r\s]*\.newReportingPlantNullable\(([^,]+),[\n\r\s]*\{\s*subject\s*\}[\n\r\s]*,[^\)]+\)
Replace:
(empty string)
In case the above search&replace did not find anything (because your code is different):
Switch from AssertImpl.coreFactory.newReportingPlant
to ExpectBuilder
=> see atriumVerbs.kt for an example of how own assertion verbs are defined now; or use the suggested replacements but please add import ch.tutteli.atrium.domain.builders.reporting.ExpectBuilder
first as it will not work correctly otherwise due to an Intellij bug
=> Note that you don't need a verb for nullable types any more. Thus:
T: Any
act: () -> Unit
Switch to new built-in assertion verbs which use Expect
Search: import ch.tutteli.atrium.verbs.(expect|assert|assertThat)
Replace: import ch.tutteli.atrium.api.verbs.$1
Switch from AssertImpl to ExpectImpl
Search: AssertImpl
Replace: ExpectImpl
Switch all your assertion functions to use Expect and no longer Assert:
Search: import ch\.tutteli\.atrium\.creating\.Assert(ionPlant(Nullable)?)?
Replace: import ch.tutteli.atrium.creating.Expect
Search: fun Assert(?:ionPlant(?:Nullable)?)?<(.*)>\.
Replace: fun <T: $1> Expect<T>\.
Search: Assert(ionPlant(Nullable)?)?<
Replace: Expect<
Switch the API
Search: import ch.tutteli\.atrium\.api\.cc\.(en_GB|de_CH)
Replace: import ch.tutteli.atrium.api.fluent.$1
isLessOr/isGreaterOrEquals
Search: is(Less|Greater)OrEquals
Replace: is$1ThanOrEqual
In case you have custom assertion verbs
Dealing with thrown exceptions is now handled by Expect
as well.
However, in case you have named the assertion verb differently for expecting an Exception then you have to decide:
act: () -> Unit
to the same name and remove it afterwardsact: () -> Unit
to the other verbCheck if you need to add import ch.tutteli.atrium.domain.builders.reporting.ExpectBuilder
Try to reduce duplicated Expect imports
Repeat until you don't have duplicate imports anymore
Search: import ch\.tutteli\.atrium\.creating\.Expect\n\s*import ch\.tutteli\.atrium\.creating\.Expect
Replace: import ch.tutteli.atrium.creating.Expect
Try to compile your project and watch out for the following warnings:
'MyClass' is a final type, and thus a value of the type parameter is predetermined
@file:Suppress("FINAL_UPPER_BOUND")
to your file, this is actually a Kotlin bug (https://youtrack.jetbrains.com/issue/KT-34257)