Skip to content

Migrate JUnit asserts to AssertJ - migration #2309

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

Closed

Conversation

Pankraz76
Copy link
Contributor

@Bukama
Copy link

Bukama commented May 9, 2025

Have we decided to go away from JUnit assertions and add AssertJ?

That's not about if they are "better" or not, but I have in mind that Maven only uses core JUnit ones?

@Pankraz76
Copy link
Contributor Author

For me its only about asking and avoiding overhead. JUnit will work fine as well as they have modern API as well im sure. Just going for syntax assetJ might be better in story telling:

image

With help of rewrite we should be able to apply what we desire. I would suggest to go with one single source of truth and not pay double the cost of carry and raising questions.

Thanks.

@Bukama
Copy link

Bukama commented May 9, 2025

I would suggest to go with one single source of truth and not pay double the cost of carry and raising questions.

Where was the question about migrating to AssertJ risen and discussed already? Please provide me a link, I might have overseen it in my mails.

@Pankraz76
Copy link
Contributor Author

no i have not done that as im not aware of ATM. I heave tried to pitch an issue but its not possible like on any project i know. Please excuse my pragmatism. Im just making offers and try to gain knowledge.

Therefore its marked draft and the liked issue POC, as its just a demo to start a thread like this.

@olamy
Copy link
Member

olamy commented May 10, 2025

https://hamcrest.org/JavaHamcrest/ is really nice
This will turn into preferences discussion :)

@Pankraz76
Copy link
Contributor Author

https://hamcrest.org/JavaHamcrest/ is really nice This will turn into preferences discussion :)

yes and checkstyle has another great solution for the exact same problem.

We use Truth

checkstyle/pom.xml

Lines 381 to 385 in 02b1e1e

com.google.truth
truth
1.4.4
test

checkstyle/checkstyle#17047 (comment)

I aim to have one to rule then all, not to ask questions which one to choose.

We dont need the overhead, its one thing like in our software design. SOC and not everything together.

@Pankraz76
Copy link
Contributor Author

Pankraz76 commented May 10, 2025

This will turn into preferences discussion :)

Leadership and the Single Source of Truth (SSOT) Imperative

The Fundamental Issue

This isn't a technical challenge - it's a leadership and standards compliance failure. We're violating basic software engineering principles that were settled decades ago.

Current Unacceptable State:

  • ▶️ 3 competing styles creating maintenance nightmares
  • ▶️ Architectural indecision masquerading as flexibility
  • ▶️ Violating the SSOT principle at massive future cost

Non-Negotiable Truths

  1. This isn't debatable
    SSOT isn't some "interesting approach" - it's table stakes for professional software development.
    "Which style should we use?" is the wrong question - the right question is "Why aren't we enforcing our standard?"

  2. Framework neutrality

    - Arguing about frameworks while ignoring architectural integrity
    + Standardizing first, then implementing consistently
    

Yes Hamcrest is really nice.

Lets pick one and go with that, removing rivals and using gained liberty.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants