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

RAD-382 Create RadiologyReportServiceTest #504

Merged
merged 1 commit into from
Feb 22, 2017

Conversation

manuela-grindei
Copy link
Contributor

@manuela-grindei manuela-grindei commented Dec 22, 2016

Description

Created unit tests for RadiologyReportServiceTest and removed unnecessary integration tests.

Related Issue

see https://issues.openmrs.org/browse/RAD-382

Checklist:

  • My pull request only contains one single commit.
  • My pull request is based on the latest master branch
    git pull --rebase upstream master.
  • I ran mvn clean package right before creating this pull request and
    added all formatting changes to my commit.
  • My code follows the code style of this project.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@mention-bot
Copy link

@manuela-grindei, thanks for your PR! By analyzing the history of the files in this pull request, we identified @teleivo, @durac and @bgeVam to be potential reviewers.

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.1%) to 94.079% when pulling 08560e4 on manuela-grindei:master into 2d98c5a on openmrs:master.

@dkayiwa
Copy link
Member

dkayiwa commented Jan 18, 2017

@teleivo do you think this is fit to merge?

@dkayiwa
Copy link
Member

dkayiwa commented Jan 27, 2017

@ivange94 do you think you can review this? :)

Copy link
Contributor

@ivange94 ivange94 left a comment

Choose a reason for hiding this comment

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

@ivange94
Copy link
Contributor

That was suppose to be a comment instead of suggestion of changes. :D

@manuela-grindei
Copy link
Contributor Author

@ivange94 Hello, thank you for reviewing this!
I skipped that one on purpose, as the class under test is not doing actual validation, but calling the validator. In these conditions, I thought it would be best to leave it as an integration. I could add a unit test using doThrow(Exception), but I'm not sure it would be that valuable.

@ivange94
Copy link
Contributor

ivange94 commented Jan 29, 2017

@manuela-grindei yes you are right. Just forget about my previous comment(I deleted it). Just stepped through the code and the saveRadiologyReport does not actually do the validation. I think this is a testing behavior vs testing implementation problem. To my knowledge we test for behavior, thats why we use mocks and in this case what that test is doing is testing how that method will behave when an invalid report is passed. Its not testing who is actually doing the validation(which I think is testing the implementation). So I still think you should extract that test method out of the integration test. @dkayiwa what do you think?

@dkayiwa
Copy link
Member

dkayiwa commented Feb 6, 2017

@teleivo now that you are back, do you think we can merge this? :)

@dkayiwa
Copy link
Member

dkayiwa commented Feb 13, 2017

@teleivo should i help you merge this? :)

/**
* Tests {@link RadiologyReportService}
*/
@RunWith(MockitoJUnitRunner.class)
Copy link
Member

@teleivo teleivo Feb 6, 2017

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good point, removed it!

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.1%) to 94.079% when pulling 8665885 on manuela-grindei:master into da4c9d2 on openmrs:master.

@dkayiwa
Copy link
Member

dkayiwa commented Feb 22, 2017

@teleivo what do you think of this? 😊

@teleivo teleivo merged commit 7dc5d01 into openmrs:master Feb 22, 2017
@teleivo
Copy link
Member

teleivo commented Feb 22, 2017

@manuela-grindei thank you very much and sorry for taking so long! 😉 @dkayiwa

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.

6 participants