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

BahmniPatientProfileResourceTest#updatePatient() fails when actually adding relationships #68

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
import org.openmrs.module.webservices.rest.web.api.RestService;
import org.openmrs.module.webservices.rest.web.resource.impl.DelegatingResourceDescription;
import org.openmrs.module.webservices.rest.web.v1_0.resource.openmrs1_8.PatientResource1_8;
import org.openmrs.module.webservices.rest.web.v1_0.resource.openmrs1_8.PersonResource1_8;
rbuisson marked this conversation as resolved.
Show resolved Hide resolved
import org.powermock.api.mockito.PowerMockito;
import org.powermock.core.classloader.annotations.PrepareForTest;
import org.powermock.modules.junit4.PowerMockRunner;
Expand Down Expand Up @@ -63,6 +64,7 @@ public class BahmniPatientProfileResourceTest {
@Mock
PatientResource1_8 patientResource1_8;


Copy link
Collaborator

Choose a reason for hiding this comment

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

Remove this as well.

@Mock
private AdministrationService administrationService;

Expand Down Expand Up @@ -163,4 +165,4 @@ public void shouldThrowExceptionWhenPatientIsNotHavingProperPrivilege() throws E
ResponseEntity<Object> response = spy.update("someUuid", propertiesToCreate);
Assert.assertEquals(403,response.getStatusCode().value());
}
}
}
15 changes: 13 additions & 2 deletions bahmnicore-omod/src/test/resources/patient.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,5 +43,16 @@

]
},
"relationships": []
}
"relationships": [
{
"relationshipType": {
"uuid": "2a5f4ff4-a179-4b8a-aa4c-40f71956eabc"
},
"personB": {
"display": "abishek kumar Anand",
"uuid": "592b29e1-b3f5-423e-83cb-0d2c9b80867f"
},
"endDate": "2020-04-06T21:00:00.000Z"
}
]
}