mirror of
https://github.com/jlengrand/atrium.git
synced 2026-03-10 08:01:19 +00:00
deprecate asExpect and IterableAssertions in domain
This commit is contained in:
@@ -18,7 +18,7 @@ import ch.tutteli.atrium.domain.creating.iterable.contains.searchbehaviours.NotS
|
||||
*
|
||||
* It loads the implementation lazily via [loadSingleService].
|
||||
*/
|
||||
//TODO 0.14.0 deprecate
|
||||
@Deprecated("Use _logic from ch.tutteli.atrium.logic instead; will be removed with 1.0.0")
|
||||
val iterableAssertions by lazy { loadSingleService(IterableAssertions::class) }
|
||||
|
||||
|
||||
@@ -26,7 +26,10 @@ val iterableAssertions by lazy { loadSingleService(IterableAssertions::class) }
|
||||
* Defines the minimum set of assertion functions and builders applicable to [Iterable],
|
||||
* which an implementation of the domain of Atrium has to provide.
|
||||
*/
|
||||
//TODO 0.14.0 deprecate
|
||||
@Deprecated(
|
||||
"Use IterableLikeAssertions from atrium-logic; will be removed with 1.0.0",
|
||||
ReplaceWith("ch.tutteli.atrium.logic.IteratorAssertions")
|
||||
)
|
||||
interface IterableAssertions {
|
||||
fun <E, T : Iterable<E>> containsBuilder(subjectProvider: SubjectProvider<T>): IterableContains.Builder<E, T, NoOpSearchBehaviour>
|
||||
fun <E, T : Iterable<E>> containsNotBuilder(subjectProvider: SubjectProvider<T>): IterableContains.Builder<E, T, NotSearchBehaviour>
|
||||
|
||||
@@ -86,9 +86,8 @@ fun <T : Any> asSubExpect(
|
||||
*
|
||||
* Try to switch entirely to [Expect] as [Assert] along with this function will be removed with 1.0.0
|
||||
*/
|
||||
//TODO deprecate with 0.14.0
|
||||
//@Deprecated("Switch from Assert to Expect, this function was introduced in 0.9.0 to ease the migration from Assert to Expect; will be removed with 1.0.0")
|
||||
@Suppress("DEPRECATION")
|
||||
@Deprecated("Switch from Assert to Expect, this function was introduced in 0.9.0 to ease the migration from Assert to Expect; will be removed with 1.0.0")
|
||||
@Suppress("DEPRECATION", "DeprecatedCallableAddReplaceWith")
|
||||
fun <T : Any?, A : BaseAssertionPlant<T, *>> A.asExpect(): Expect<T> =
|
||||
DelegatingExpect(this, this.maybeSubject)
|
||||
|
||||
@@ -100,9 +99,8 @@ fun <T : Any?, A : BaseAssertionPlant<T, *>> A.asExpect(): Expect<T> =
|
||||
*
|
||||
* @returns The deprecated plant.
|
||||
*/
|
||||
//TODO deprecate with 0.14.0
|
||||
//@Deprecated("Switch from Assert to Expect, this function was introduced in 0.9.0 to ease the migration from Assert to Expect; will be removed with 1.0.0")
|
||||
@Suppress("DEPRECATION")
|
||||
@Deprecated("Switch from Assert to Expect, this function was introduced in 0.9.0 to ease the migration from Assert to Expect; will be removed with 1.0.0")
|
||||
@Suppress("DEPRECATION", "DeprecatedCallableAddReplaceWith")
|
||||
fun <T : Any, A : BaseAssertionPlant<T, *>> A.asExpect(assertionCreator: Expect<T>.() -> Unit): A {
|
||||
asExpect().addAssertionsCreatedBy(assertionCreator)
|
||||
return this
|
||||
|
||||
Reference in New Issue
Block a user