Giter VIP home page Giter VIP logo

Comments (6)

joel-costigliola avatar joel-costigliola commented on July 23, 2024

The plugin only generates assertions entry points (i.e. assertThat methods) for generated Assert classes since it does not know the other existing Assert classes.

You could write your own Assertions class inheriting from the generated one and add the assertThat methods for your manually defined Assert classes.

Another option would be to to add manually assertThat to the generated Assertions and move it to source control, the problem is that for the time being you can't disable Assertions from being generated, something that should be possible.

SoftAssertions is for people not using JUnit, having said that we should probably provide an option to generate JUnitSoftAssertions and a way to disable it for non JUnit users (see assertj/assertj-assertions-generator#33).

from assertj-assertions-generator-maven-plugin.

dibog avatar dibog commented on July 23, 2024

Joel,
first thanks for the framework and the assertions generator, I like them both.
But back to my question, would you agree that it would be nice to have hand made
Assert also to be rolled into the generated Assertions? Wouldn't it be possible
to mark Assert with some annotation so that there are no Assert generated for handmade Assert and that those handmade Assert should be rolled into the generated Assertions?

from assertj-assertions-generator-maven-plugin.

joel-costigliola avatar joel-costigliola commented on July 23, 2024

That could be an option, I need to think about.
The annotation must be added to assertj-core, this will delay this improvement.

from assertj-assertions-generator-maven-plugin.

joel-costigliola avatar joel-costigliola commented on July 23, 2024

@dibog if you are still interested in this issue, can you provide an example of how things should work ?

from assertj-assertions-generator-maven-plugin.

dibog avatar dibog commented on July 23, 2024

Hi Joel,

I'm now using AssertJ without custom written/generated Assertions. E.g.
taking you Player example:

Instead of PlayerAssert.assertThat(player).hasNoTeams() I'm doing
Assertions.assertThat(player.getTeam()).hasLength(0) or similary.

I checked today your assert-generation again, and I currently have problems
that eclipse doesn't see your generated assertions.
E.g.my test case using your generated code marks an error, while running
maven on the command line works fine.

Best regards,
Dieter

2015-07-25 13:10 GMT+02:00 Joel Costigliola [email protected]:

@dibog https://github.com/dibog if you are still interested in this
issue, can you provide an example of how things should work ?


Reply to this email directly or view it on GitHub
#22 (comment)
.

from assertj-assertions-generator-maven-plugin.

joel-costigliola avatar joel-costigliola commented on July 23, 2024

You need to set the directory where sources are generated as an eclipse source (project > java build path > Add folder in the Source tab. The other solution is to generate the classes directly in a source directory known by eclipse (ex : src/test/java).

if it runs fine from maven command line, then it's just a matter of configuring correctly your eclipse project.

I'm closing this issue as it's not a problem anymore.

from assertj-assertions-generator-maven-plugin.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.