intellij-generateAllSetMethod icon indicating copy to clipboard operation
intellij-generateAllSetMethod copied to clipboard

Please add JUnit 5 support

Open MartinX3 opened this issue 6 years ago • 6 comments

"assert all getters" generates a long "assertThat(xx.getxx()).isEqualTo();" list. "assertThat" is not anymore in JUnit 5.

Please use something dependent on the getter return type or simply use "assertEquals(xx expected, xx actual)"

MartinX3 avatar Jul 24 '19 14:07 MartinX3

assertThat is from assertJ, you may add depedency from https://joel-costigliola.github.io/assertj/

gejun123456 avatar Jul 25 '19 01:07 gejun123456

Thank you for the information :)

Ah, hamcrest like assertions https://junit.org/junit5/docs/current/user-guide/#writing-tests-assertions-third-party

I'll look if my company allows to add this into the projects.

It just looked for me like an bug in the first place, because JUnit 5 deprecated and removed assertThat.

But it's another dependency I need to add and maintain. Happy dependency hell. :dizzy_face:

MartinX3 avatar Jul 25 '19 08:07 MartinX3

I think that it will be possible to add without any dependency in plugin side. Just add generate asserts with hamcrestAssertions entry and generate the code. And let the user choose, if it choose that it is expected that he will have the dependency in it's project.

lujop avatar Oct 15 '20 06:10 lujop

Any news about this evolve :) ?

H3llK33p3r avatar Mar 03 '21 10:03 H3llK33p3r

how about support Hamcrest

shalk avatar Aug 05 '22 08:08 shalk

I suggest adding an ability to choose your preferred testing framework in settings in case if you have more than one on your classpath. What do you think?

vkotelnikov avatar Oct 15 '23 19:10 vkotelnikov