Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

deprecate ChronoZonedDateTime.toBeLessThan etc. #709

Closed
robstoll opened this issue Dec 9, 2020 · 5 comments · Fixed by #1204
Closed

deprecate ChronoZonedDateTime.toBeLessThan etc. #709

robstoll opened this issue Dec 9, 2020 · 5 comments · Fixed by #1204
Assignees
Milestone

Comments

@robstoll
Copy link
Owner

robstoll commented Dec 9, 2020

Platform (all, jvm, js): jvm
Extension (none, kotlin 1.3): none

Code related feature

val now = ZonedDateTime.now()
now.compareTo(now.withZoneSameInstant(ZoneOffset.UTC)) // 1
now.isEqual(now.withZoneSameInstant(ZoneOffset.UTC)) // true

We should deprecated the Comparable assertion functions in the context of ZonedDateTime and point to toBeBefore, toBeAfter etc.

See robstoll/atrium-roadmap#50 for further details

Your first contribution?

  • Write a comment I'll work on this if you would like to take this issue over.
    This way we get the chance to revise the description in case things have changed in the meantime, we might give you additional hints and we can assign the task to you, so that others do not start as well.
  • See Your first code contribution for guidelines.
  • Do not hesitate to ask questions here or to contact us via Atrium's slack channel if you need help
    (Invite yourself in case you do not have an account yet).
@robstoll robstoll changed the title deprecate ChronoZonedDateTime.isLessThan etc. deprecate ChronoZonedDateTime.toBeLessThan etc. Oct 22, 2021
@robstoll robstoll added good first issue Good for newcomers and removed hacktoberfest labels Nov 3, 2021
@JordanllHarper
Copy link
Contributor

Hi I would like to take this on!

@JordanllHarper
Copy link
Contributor

@robstoll I'm just wanting to double check, are you wanting the methods in ' /logic/atrium-logic/src/generated/jvmMain/ch/tutteli/atrium/logic/chronoZonedDateTime.kt ' deprecated? If not, could you point me to the path where I'm needing to deprecate?

@robstoll
Copy link
Owner Author

robstoll commented Sep 28, 2022

@JordanllHarper no, you don't deprecate existing functions, you add new overloads for the existing functions in https://github.com/robstoll/atrium/blob/main/apis/fluent-en_GB/atrium-api-fluent-en_GB/src/commonMain/kotlin/ch/tutteli/atrium/api/fluent/en_GB/comparableExpectations.kt
for the type ChronoZonedDateTime to the corresponding file in jvmMainn (i.e. to /apis/fluent-en_GB/atrium-api-fluent-en_GB/src/jvmMain/kotlin/ch/tutteli/atrium/api/fluent/en_GB/chronoZonedDateTimeExpectations.k).
Once you added the overloads, you immediately deprecated them again. We don't intend to remove them again (otherwise there would not be a need to add them in the first place), we will have them as hint for the user as their usage is most likely wrong. See https://github.com/robstoll/atrium/blob/main/apis/fluent-en_GB/atrium-api-fluent-en_GB/src/jvmMain/kotlin/ch/tutteli/atrium/api/fluent/en_GB/bigDecimalExpectations.kt => toEqual. Your deprecated functions should be similar. Also throw a PleaseUseReplacementException and point out that one can use a feature extractor if one desperately want to use toBeGreaterThan and co. on ChronoZonedDateTime. I hope you see a bit what you need to do. Otherwise let me know, I can also create to-dos for this issue which will be more or less a step by step instruction

Same same for the api-infix

@JordanllHarper
Copy link
Contributor

@robstoll I think I understand what you are asking me to do and I'm still working on this!
However, I'm having some issues importing java standard libraries into the comparableExpectations.kt file for both API's. I can't access the java stdlib from the file and am needing some help with this. Apologies for this!

@robstoll
Copy link
Owner Author

robstoll commented Oct 8, 2022

@JordanllHarper no worries, can you please push your changes and create a WIP PR (a draft). It's way easier to help with setting your code

@robstoll robstoll added this to the 0.19.0 milestone Oct 13, 2022
@robstoll robstoll linked a pull request Oct 13, 2022 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants