diff --git a/apis/fluent-en_GB/atrium-api-fluent-en_GB-jvm/src/main/kotlin/ch/tutteli/atrium/api/fluent/en_GB/chronoZonedDateTimeAssertions.kt b/apis/fluent-en_GB/atrium-api-fluent-en_GB-jvm/src/main/kotlin/ch/tutteli/atrium/api/fluent/en_GB/chronoZonedDateTimeAssertions.kt index c2398a5b6..e8899a706 100644 --- a/apis/fluent-en_GB/atrium-api-fluent-en_GB-jvm/src/main/kotlin/ch/tutteli/atrium/api/fluent/en_GB/chronoZonedDateTimeAssertions.kt +++ b/apis/fluent-en_GB/atrium-api-fluent-en_GB-jvm/src/main/kotlin/ch/tutteli/atrium/api/fluent/en_GB/chronoZonedDateTimeAssertions.kt @@ -18,6 +18,10 @@ import java.time.chrono.ChronoZonedDateTime * * @since 0.9.0 */ +@Deprecated( + "Use toBeBefore; will be removed with 1.0.0 at the latest", + ReplaceWith("this.toBeBefore(expected)") +) fun > Expect.isBefore( expected: ChronoZonedDateTime<*> ): Expect = _logicAppend { isBefore(expected) } @@ -30,6 +34,10 @@ fun > Expect.isBefore( * * @since 0.9.0 */ +@Deprecated( + "Use toBeBeforeOrTheSamePointInTimeAs; will be removed with 1.0.0 at the latest", + ReplaceWith("this.toBeBeforeOrTheSamePointInTimeAs(expected)") +) fun > Expect.isBeforeOrEqual( expected: ChronoZonedDateTime<*> ): Expect = _logicAppend { isBeforeOrEqual(expected) } @@ -42,6 +50,10 @@ fun > Expect.isBeforeOrEqual( * * @since 0.9.0 */ +@Deprecated( + "Use toBeAfter; will be removed with 1.0.0 at the latest", + ReplaceWith("this.toBeAfter(expected)") +) fun > Expect.isAfter( expected: ChronoZonedDateTime<*> ): Expect = _logicAppend { isAfter(expected) } @@ -54,6 +66,10 @@ fun > Expect.isAfter( * * @since 0.9.0 */ +@Deprecated( + "Use toBeAfterOrTheSamePointInTimeAs; will be removed with 1.0.0 at the latest", + ReplaceWith("this.toBeAfterOrTheSamePointInTimeAs(expected)") +) fun > Expect.isAfterOrEqual( expected: ChronoZonedDateTime<*> ): Expect = _logicAppend { isAfterOrEqual(expected) } @@ -66,6 +82,10 @@ fun > Expect.isAfterOrEqual( * * @since 0.9.0 */ +@Deprecated( + "Use toBeTheSamePointInTimeAs; will be removed with 1.0.0 at the latest", + ReplaceWith("this.toBeTheSamePointInTimeAs(expected)") +) fun > Expect.isEqual( expected: ChronoZonedDateTime<*> ): Expect = _logicAppend { isEqual(expected) } @@ -99,6 +119,10 @@ fun > Expect.isEqual( * * @since 0.14.0 */ +@Deprecated( + "Use toBeBefore; will be removed with 1.0.0 at the latest", + ReplaceWith("this.toBeBefore(expected)") +) fun > Expect.isBefore( expected: String ): Expect = _logicAppend { isBefore(expected) } @@ -132,6 +156,10 @@ fun > Expect.isBefore( * * @since 0.14.0 */ +@Deprecated( + "Use toBeBeforeOrTheSamePointInTimeAs; will be removed with 1.0.0 at the latest", + ReplaceWith("this.toBeBeforeOrTheSamePointInTimeAs(expected)") +) fun > Expect.isBeforeOrEqual( expected: String ): Expect = _logicAppend { isBeforeOrEqual(expected) } @@ -165,6 +193,10 @@ fun > Expect.isBeforeOrEqual( * * @since 0.14.0 */ +@Deprecated( + "Use toBeAfter; will be removed with 1.0.0 at the latest", + ReplaceWith("this.toBeAfter(expected)") +) fun > Expect.isAfter( expected: String ): Expect = _logicAppend { isAfter(expected) } @@ -198,6 +230,10 @@ fun > Expect.isAfter( * * @since 0.14.0 */ +@Deprecated( + "Use toBeAfterOrTheSamePointInTimeAs; will be removed with 1.0.0 at the latest", + ReplaceWith("this.toBeAfterOrTheSamePointInTimeAs(expected)") +) fun > Expect.isAfterOrEqual( expected: String ): Expect = _logicAppend { isAfterOrEqual(expected) } @@ -231,6 +267,10 @@ fun > Expect.isAfterOrEqual( * * @since 0.14.0 */ +@Deprecated( + "Use toBeTheSamePointInTimeAs; will be removed with 1.0.0 at the latest", + ReplaceWith("this.toBeTheSamePointInTimeAs(expected)") +) fun > Expect.isEqual( expected: String ): Expect = _logicAppend { isEqual(expected) } diff --git a/apis/fluent-en_GB/atrium-api-fluent-en_GB-jvm/src/test/kotlin/ch/tutteli/atrium/api/fluent/en_GB/ChronoLocalDateTimeExpectationsSpec.kt b/apis/fluent-en_GB/atrium-api-fluent-en_GB-jvm/src/test/kotlin/ch/tutteli/atrium/api/fluent/en_GB/ChronoLocalDateTimeExpectationsSpec.kt index e163fc308..6e48f13f6 100644 --- a/apis/fluent-en_GB/atrium-api-fluent-en_GB-jvm/src/test/kotlin/ch/tutteli/atrium/api/fluent/en_GB/ChronoLocalDateTimeExpectationsSpec.kt +++ b/apis/fluent-en_GB/atrium-api-fluent-en_GB-jvm/src/test/kotlin/ch/tutteli/atrium/api/fluent/en_GB/ChronoLocalDateTimeExpectationsSpec.kt @@ -87,19 +87,15 @@ class ChronoLocalDateTimeExpectationsSpec : Spek({ a4 = a4.toBeTheSamePointInTimeAs(chronoLocalDateTime) a1 = a1.toBeBefore("also not ambiguous if string is passed") - a1 = - a1.toBeBeforeOrTheSamePointInTimeAs("also not ambiguous if string is passed") + a1 = a1.toBeBeforeOrTheSamePointInTimeAs("also not ambiguous if string is passed") a1 = a1.toBeAfter("also not ambiguous if string is passed") - a1 = - a1.toBeAfterOrTheSamePointInTimeAs("also not ambiguous if string is passed") + a1 = a1.toBeAfterOrTheSamePointInTimeAs("also not ambiguous if string is passed") a1 = a1.toBeTheSamePointInTimeAs("also not ambiguous if string is passed") a2 = a2.toBeBefore("also not ambiguous if string is passed") - a2 = - a2.toBeBeforeOrTheSamePointInTimeAs("also not ambiguous if string is passed") + a2 = a2.toBeBeforeOrTheSamePointInTimeAs("also not ambiguous if string is passed") a2 = a2.toBeAfter("also not ambiguous if string is passed") - a2 = - a2.toBeAfterOrTheSamePointInTimeAs("also not ambiguous if string is passed") + a2 = a2.toBeAfterOrTheSamePointInTimeAs("also not ambiguous if string is passed") a2 = a2.toBeTheSamePointInTimeAs("also not ambiguous if string is passed") a3 = a3.toBeBefore("also not ambiguous if string is passed") diff --git a/apis/fluent-en_GB/atrium-api-fluent-en_GB-jvm/src/test/kotlin/ch/tutteli/atrium/api/fluent/en_GB/ChronoZonedDateTimeExpectationsSpec.kt b/apis/fluent-en_GB/atrium-api-fluent-en_GB-jvm/src/test/kotlin/ch/tutteli/atrium/api/fluent/en_GB/ChronoZonedDateTimeExpectationsSpec.kt index 9f9cf8e92..c7f35ddd9 100644 --- a/apis/fluent-en_GB/atrium-api-fluent-en_GB-jvm/src/test/kotlin/ch/tutteli/atrium/api/fluent/en_GB/ChronoZonedDateTimeExpectationsSpec.kt +++ b/apis/fluent-en_GB/atrium-api-fluent-en_GB-jvm/src/test/kotlin/ch/tutteli/atrium/api/fluent/en_GB/ChronoZonedDateTimeExpectationsSpec.kt @@ -20,13 +20,14 @@ class ChronoZonedDateTimeExpectationsSpec : Spek({ fun1, ChronoZonedDateTime<*>>(Expect>::toBeTheSamePointInTimeAs) ) - object ChronoZonedDateTimeAsStringSpec : ch.tutteli.atrium.specs.integration.ChronoZonedDateTimeAsStringExpectationsSpec( - fun1, String>(Expect>::toBeBefore), - fun1, String>(Expect>::toBeBeforeOrTheSamePointInTimeAs), - fun1, String>(Expect>::toBeAfter), - fun1, String>(Expect>::toBeAfterOrTheSamePointInTimeAs), - fun1, String>(Expect>::toBeTheSamePointInTimeAs) - ) + object ChronoZonedDateTimeAsStringSpec : + ch.tutteli.atrium.specs.integration.ChronoZonedDateTimeAsStringExpectationsSpec( + fun1, String>(Expect>::toBeBefore), + fun1, String>(Expect>::toBeBeforeOrTheSamePointInTimeAs), + fun1, String>(Expect>::toBeAfter), + fun1, String>(Expect>::toBeAfterOrTheSamePointInTimeAs), + fun1, String>(Expect>::toBeTheSamePointInTimeAs) + ) @Suppress("unused", "UNUSED_VALUE") private fun ambiguityTest() { @@ -37,77 +38,77 @@ class ChronoZonedDateTimeExpectationsSpec : Spek({ var a4: Expect = notImplemented() - a1 = a1.isBefore(ZonedDateTime.now()) - a1 = a1.isBeforeOrEqual(ZonedDateTime.now()) - a1 = a1.isAfter(ZonedDateTime.now()) - a1 = a1.isAfterOrEqual(ZonedDateTime.now()) - a1 = a1.isEqual(ZonedDateTime.now()) + a1 = a1.toBeBefore(ZonedDateTime.now()) + a1 = a1.toBeBeforeOrTheSamePointInTimeAs(ZonedDateTime.now()) + a1 = a1.toBeAfter(ZonedDateTime.now()) + a1 = a1.toBeAfterOrTheSamePointInTimeAs(ZonedDateTime.now()) + a1 = a1.toBeTheSamePointInTimeAs(ZonedDateTime.now()) - a2 = a2.isBefore(ZonedDateTime.now()) - a2 = a2.isBeforeOrEqual(ZonedDateTime.now()) - a2 = a2.isAfter(ZonedDateTime.now()) - a2 = a2.isAfterOrEqual(ZonedDateTime.now()) - a2 = a2.isEqual(ZonedDateTime.now()) + a2 = a2.toBeBefore(ZonedDateTime.now()) + a2 = a2.toBeBeforeOrTheSamePointInTimeAs(ZonedDateTime.now()) + a2 = a2.toBeAfter(ZonedDateTime.now()) + a2 = a2.toBeAfterOrTheSamePointInTimeAs(ZonedDateTime.now()) + a2 = a2.toBeTheSamePointInTimeAs(ZonedDateTime.now()) - a3 = a3.isBefore(ZonedDateTime.now()) - a3 = a3.isBeforeOrEqual(ZonedDateTime.now()) - a3 = a3.isAfter(ZonedDateTime.now()) - a3 = a3.isAfterOrEqual(ZonedDateTime.now()) - a3 = a3.isEqual(ZonedDateTime.now()) + a3 = a3.toBeBefore(ZonedDateTime.now()) + a3 = a3.toBeBeforeOrTheSamePointInTimeAs(ZonedDateTime.now()) + a3 = a3.toBeAfter(ZonedDateTime.now()) + a3 = a3.toBeAfterOrTheSamePointInTimeAs(ZonedDateTime.now()) + a3 = a3.toBeTheSamePointInTimeAs(ZonedDateTime.now()) - a4 = a4.isBefore(ZonedDateTime.now()) - a4 = a4.isBeforeOrEqual(ZonedDateTime.now()) - a4 = a4.isAfter(ZonedDateTime.now()) - a4 = a4.isAfterOrEqual(ZonedDateTime.now()) - a4 = a4.isEqual(ZonedDateTime.now()) + a4 = a4.toBeBefore(ZonedDateTime.now()) + a4 = a4.toBeBeforeOrTheSamePointInTimeAs(ZonedDateTime.now()) + a4 = a4.toBeAfter(ZonedDateTime.now()) + a4 = a4.toBeAfterOrTheSamePointInTimeAs(ZonedDateTime.now()) + a4 = a4.toBeTheSamePointInTimeAs(ZonedDateTime.now()) - a1 = a1.isBefore(chronoZonedDateTime) - a1 = a1.isBeforeOrEqual(chronoZonedDateTime) - a1 = a1.isAfter(chronoZonedDateTime) - a1 = a1.isAfterOrEqual(chronoZonedDateTime) - a1 = a1.isEqual(chronoZonedDateTime) + a1 = a1.toBeBefore(chronoZonedDateTime) + a1 = a1.toBeBeforeOrTheSamePointInTimeAs(chronoZonedDateTime) + a1 = a1.toBeAfter(chronoZonedDateTime) + a1 = a1.toBeAfterOrTheSamePointInTimeAs(chronoZonedDateTime) + a1 = a1.toBeTheSamePointInTimeAs(chronoZonedDateTime) - a2 = a2.isBefore(chronoZonedDateTime) - a2 = a2.isBeforeOrEqual(chronoZonedDateTime) - a2 = a2.isAfter(chronoZonedDateTime) - a2 = a2.isAfterOrEqual(chronoZonedDateTime) - a2 = a2.isEqual(chronoZonedDateTime) + a2 = a2.toBeBefore(chronoZonedDateTime) + a2 = a2.toBeBeforeOrTheSamePointInTimeAs(chronoZonedDateTime) + a2 = a2.toBeAfter(chronoZonedDateTime) + a2 = a2.toBeAfterOrTheSamePointInTimeAs(chronoZonedDateTime) + a2 = a2.toBeTheSamePointInTimeAs(chronoZonedDateTime) - a3 = a3.isBefore(chronoZonedDateTime) - a3 = a3.isBeforeOrEqual(chronoZonedDateTime) - a3 = a3.isAfter(chronoZonedDateTime) - a3 = a3.isAfterOrEqual(chronoZonedDateTime) - a3 = a3.isEqual(chronoZonedDateTime) + a3 = a3.toBeBefore(chronoZonedDateTime) + a3 = a3.toBeBeforeOrTheSamePointInTimeAs(chronoZonedDateTime) + a3 = a3.toBeAfter(chronoZonedDateTime) + a3 = a3.toBeAfterOrTheSamePointInTimeAs(chronoZonedDateTime) + a3 = a3.toBeTheSamePointInTimeAs(chronoZonedDateTime) - a4 = a4.isBefore(chronoZonedDateTime) - a4 = a4.isBeforeOrEqual(chronoZonedDateTime) - a4 = a4.isAfter(chronoZonedDateTime) - a4 = a4.isAfterOrEqual(chronoZonedDateTime) - a4 = a4.isEqual(chronoZonedDateTime) + a4 = a4.toBeBefore(chronoZonedDateTime) + a4 = a4.toBeBeforeOrTheSamePointInTimeAs(chronoZonedDateTime) + a4 = a4.toBeAfter(chronoZonedDateTime) + a4 = a4.toBeAfterOrTheSamePointInTimeAs(chronoZonedDateTime) + a4 = a4.toBeTheSamePointInTimeAs(chronoZonedDateTime) - a1 = a1.isBefore("also not ambiguous if string is passed") - a1 = a1.isBeforeOrEqual("also not ambiguous if string is passed") - a1 = a1.isAfter("also not ambiguous if string is passed") - a1 = a1.isAfterOrEqual("also not ambiguous if string is passed") - a1 = a1.isEqual("also not ambiguous if string is passed") + a1 = a1.toBeBefore("also not ambiguous if string is passed") + a1 = a1.toBeBeforeOrTheSamePointInTimeAs("also not ambiguous if string is passed") + a1 = a1.toBeAfter("also not ambiguous if string is passed") + a1 = a1.toBeAfterOrTheSamePointInTimeAs("also not ambiguous if string is passed") + a1 = a1.toBeTheSamePointInTimeAs("also not ambiguous if string is passed") - a2 = a2.isBefore("also not ambiguous if string is passed") - a2 = a2.isBeforeOrEqual("also not ambiguous if string is passed") - a2 = a2.isAfter("also not ambiguous if string is passed") - a2 = a2.isAfterOrEqual("also not ambiguous if string is passed") - a2 = a2.isEqual("also not ambiguous if string is passed") + a2 = a2.toBeBefore("also not ambiguous if string is passed") + a2 = a2.toBeBeforeOrTheSamePointInTimeAs("also not ambiguous if string is passed") + a2 = a2.toBeAfter("also not ambiguous if string is passed") + a2 = a2.toBeAfterOrTheSamePointInTimeAs("also not ambiguous if string is passed") + a2 = a2.toBeTheSamePointInTimeAs("also not ambiguous if string is passed") - a3 = a3.isBefore("also not ambiguous if string is passed") - a3 = a3.isBeforeOrEqual("also not ambiguous if string is passed") - a3 = a3.isAfter("also not ambiguous if string is passed") - a3 = a3.isAfterOrEqual("also not ambiguous if string is passed") - a3 = a3.isEqual("also not ambiguous if string is passed") + a3 = a3.toBeBefore("also not ambiguous if string is passed") + a3 = a3.toBeBeforeOrTheSamePointInTimeAs("also not ambiguous if string is passed") + a3 = a3.toBeAfter("also not ambiguous if string is passed") + a3 = a3.toBeAfterOrTheSamePointInTimeAs("also not ambiguous if string is passed") + a3 = a3.toBeTheSamePointInTimeAs("also not ambiguous if string is passed") - a4 = a4.isBefore("also not ambiguous if string is passed") - a4 = a4.isBeforeOrEqual("also not ambiguous if string is passed") - a4 = a4.isAfter("also not ambiguous if string is passed") - a4 = a4.isAfterOrEqual("also not ambiguous if string is passed") - a4 = a4.isEqual("also not ambiguous if string is passed") + a4 = a4.toBeBefore("also not ambiguous if string is passed") + a4 = a4.toBeBeforeOrTheSamePointInTimeAs("also not ambiguous if string is passed") + a4 = a4.toBeAfter("also not ambiguous if string is passed") + a4 = a4.toBeAfterOrTheSamePointInTimeAs("also not ambiguous if string is passed") + a4 = a4.toBeTheSamePointInTimeAs("also not ambiguous if string is passed") } } diff --git a/misc/specs/atrium-specs-jvm/src/main/kotlin/ch/tutteli/atrium/specs/integration/ChronoZonedDateTimeExpectationsSpec.kt b/misc/specs/atrium-specs-jvm/src/main/kotlin/ch/tutteli/atrium/specs/integration/ChronoZonedDateTimeExpectationsSpec.kt index 14b7b3550..618f9faa3 100644 --- a/misc/specs/atrium-specs-jvm/src/main/kotlin/ch/tutteli/atrium/specs/integration/ChronoZonedDateTimeExpectationsSpec.kt +++ b/misc/specs/atrium-specs-jvm/src/main/kotlin/ch/tutteli/atrium/specs/integration/ChronoZonedDateTimeExpectationsSpec.kt @@ -7,7 +7,6 @@ import ch.tutteli.atrium.specs.* import ch.tutteli.atrium.translations.DescriptionDateTimeLikeAssertion import org.spekframework.spek2.Spek import org.spekframework.spek2.style.specification.describe -import java.time.ZoneId import java.time.ZoneOffset import java.time.ZonedDateTime import java.time.chrono.ChronoZonedDateTime