-
Notifications
You must be signed in to change notification settings - Fork 4.1k
TRUNK-5068: Add tests to ProgramWorkflowService #4600
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
Open
helderjosue
wants to merge
11
commits into
openmrs:master
Choose a base branch
from
helderjosue:TRUNK-5068
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
9446023
TRUNK-5068: adding test for Patient Program Attribute Type by Uuid
helderjosue d3e735c
TRUNK-5068: adding header to xml file
helderjosue 697c3dd
TRUNK-5068: adding test for Patient Program Attribute Type by name
helderjosue 9146080
TRUNK-5068: correcting old tests failling
helderjosue 40d2592
TRUNK-5068: adding test for Patient Program By Attribute Name And Value
helderjosue b60abc1
TRUNK-5068: renaming test to match tests naming conventions
helderjosue 83a75bd
TRUNK-5068: adding new program_attribute_type to avoid constraint vio…
helderjosue bd48688
TRUNK-5068: update old test with new amount of program_attribute_types
helderjosue 3e21950
TRUNK-5068: correcting imports
helderjosue 8740c33
TRUNK-5068: renaming test
helderjosue 596c5c7
TRUNK-5068: removing javadocs for tests
helderjosue File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
57 changes: 57 additions & 0 deletions
57
api/src/test/resources/org/openmrs/api/include/PatientProgramAttributeTestDataset.xml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,57 @@ | ||
| <?xml version="1.0" encoding="UTF-8"?> | ||
| <!-- | ||
|
|
||
| This Source Code Form is subject to the terms of the Mozilla Public License, | ||
| v. 2.0. If a copy of the MPL was not distributed with this file, You can | ||
| obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under | ||
| the terms of the Healthcare Disclaimer located at http://openmrs.org/license. | ||
|
|
||
| Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS | ||
| graphic logo is a trademark of OpenMRS Inc. | ||
|
|
||
| --> | ||
| <dataset> | ||
| <person person_id="2" | ||
| gender="M" | ||
| birthdate="1998-12-25" | ||
| birthdate_estimated="false" | ||
| dead="false" | ||
| creator="1" | ||
| date_created="2006-02-15 00:00:00.0" | ||
| voided="false" | ||
| uuid="6013a8cd-c6a0-4140-bfac-0af565704420"/> | ||
|
|
||
| <patient patient_id="2" | ||
| creator="1" | ||
| date_created="2016-05-15 00:00:00.0" | ||
| voided="false"/> | ||
|
|
||
| <patient_program patient_program_id="1" | ||
| patient_id="2" | ||
| program_id="1" | ||
| date_enrolled="2006-10-14 00:00:00.0" | ||
| creator="1" | ||
| date_created="2007-09-20 00:00:00.0" | ||
| voided="false" | ||
| uuid="9119b9f8-af3d-4ad8-9e2e-2317c3de91c6"/> | ||
|
|
||
| <patient_program_attribute | ||
| patient_program_attribute_id = "2" | ||
| patient_program_id = "1" | ||
| attribute_type_id = "3" | ||
| uuid = "dd8793dc-e9d2-11ee-9b67-333dbdea27a2" | ||
| creator="1" | ||
| date_created="2021-09-20 00:00:00.0" | ||
| voided="false"/> | ||
|
|
||
| <patient_program_attribute | ||
| patient_program_attribute_id = "3" | ||
| patient_program_id = "1" | ||
| attribute_type_id = "2" | ||
| value_reference = "programReference" | ||
| uuid = "da88c81a-e9da-11ee-8b19-6f54994ac15c" | ||
| creator="1" | ||
| date_created="2021-12-20 00:00:00.0" | ||
| voided="false"/> | ||
|
|
||
| </dataset> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Was this change also related to the ticket you were working on?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, because after my changes, some other tests were failing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would this mean that it was some sort of bug that your tests exposed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No! for this particular case, my task was to implement tests for this method
getPatientProgramByAttributeNameAndValuefromProgramWorkflowServiceclass. But after implementing the test, I faced an error related to the table mappingspatient_program pp is not mapped [select pp from....So I applied this changes to deal with the related issue.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I still do not get it. If it was not a bug, why do you need to fix it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It was, but not related to any code added by me. The
sessionfactoryquery was there, but was not covered by the tests. once I wrote a test, the error came up.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now, that makes perfect sense. Thanks for the clarification. 😊
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank for your time.
I will be pushing the last changes (naming conventions) shortly