Skip to content

Conversation

@staillebois
Copy link
Contributor

Fix blocker issues on sonar

Solves #508

  • Fix the 4 blocker issues related to :
    naked-objects-dom
    naked-objects-integtests

public void testName() throws Exception {
// given
String name = "Foobar";
assertThat(simpleObject.getName()).isNull();

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should use assertNull(simpleObject.getName()) here.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What I feel is, it's good that AssertJ was used for assertions. It makes assertions readable, I was planning to either use Hamcrest or AssertJ in all modules. So I think we should keep assertion as is. And I will raise other issue to discuss assertion options.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What I feel is, it's good that AssertJ was used for assertions. It makes assertions readable, I was planning to either use Hamcrest or AssertJ in all modules. So I think we should keep assertion as is. And I will raise other issue to discuss assertion options.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What I feel is, it's good that AssertJ was used for assertions. It makes assertions readable, I was planning to either use Hamcrest or AssertJ in all modules. So I think we should keep assertion as is. And I will raise other issue to discuss assertion options.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What I feel is, it's good that AssertJ was used for assertions. It makes assertions readable, I was planning to either use Hamcrest or AssertJ in all modules. So I think we should keep assertion as is. And I will raise other issue to discuss assertion options.

simpleObject.setName(name);

// then
assertThat(simpleObject.getName()).isEqualTo(name);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use assertEquals(name, simpleObject.getName()) here.

@IAmPramod
Copy link

@staillebois we should use assertEquals(<expected>,<actual>) wherever equality is being checked in the test cases.

@staillebois
Copy link
Contributor Author

staillebois commented Oct 21, 2018

Ok I will do it today, thanks for the review. You just want I replace Assertj with JUnit that's right ?

@staillebois
Copy link
Contributor Author

Done.

Copy link

@IAmPramod IAmPramod left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good now.

@npathai
Copy link
Contributor

npathai commented Oct 22, 2018

@staillebois @IAmPramod I am confused. Were sonar blockers regarding the use of AssertJ? I personally feel that AssertJ and Hamcrest assertions read much better as compared to JUnit's. I was even planning to include them in all modules.

@iluwatar Any thoughts on this?

@npathai
Copy link
Contributor

npathai commented Oct 22, 2018

What I feel is, it's good that AssertJ was used for assertions. It makes assertions readable, I was planning to either use Hamcrest or AssertJ in all modules. So I think we should keep assertion as is. And I will raise other issue to discuss assertion options.

@staillebois
Copy link
Contributor Author

Hi @npathai , I am agree with you AssertJ produce better logs. I replaced it only because of @IAmPramod 's comment and I was thinking that it was for remove the dependency with AssertJ.
But if you prefer Assertj, I can revert the last changes.

@staillebois staillebois changed the title Fix blocker issues on Sonar Fix blocker issues on Sonar #508 Oct 22, 2018
Repository owner deleted a comment from staillebois Oct 24, 2018
Repository owner deleted a comment from staillebois Oct 24, 2018
@npathai
Copy link
Contributor

npathai commented Oct 24, 2018

@staillebois It's all right now that we have already removed it. We can work on incorporating AssertJ or Hamcrest or Fest in all modules via other issue. Looks good 👍

@iluwatar
Copy link
Owner

@npathai good idea to improve the assertions in separate issue

@npathai npathai merged commit 70f6e54 into iluwatar:master Oct 25, 2018
@npathai
Copy link
Contributor

npathai commented Oct 25, 2018

@staillebois Thanks for the contribution 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants