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

#902:Updating and creating more testcases for person and patient services #1187

Closed
wants to merge 0 commits into from

Conversation

josephbate
Copy link
Contributor

Pull Requests Requirements

  • The PR title includes a brief description of the work done, including the
    Issue number if applicable.
  • The PR includes a video showing the changes for the work done.
  • The PR title follows conventional commit label standards.
  • The changes confirm to the OpenElis Global x3 Styleguide and design
    documentation.
  • The changes include tests or are validated by existing tests.
  • I have read and agree to the Contributing Guidelines of this project.

Summary

  1. added more test in the persion and patient service classes
  2. cleaned up the previous code for easy readability and also to write less code creating test cases

Screenshots

[Add relevant screenshots here if applicable]

Related Issue

see: https://github.com/orgs/I-TECH-UW/projects/6/views/1?pane=issue&itemId=57668194

[Add a link to the related issue or mention it here if applicable]

Other

[Add any additional information or notes here]

@josephbate
Copy link
Contributor Author

hello @mozzy11 please review this pr

@mozzy11
Copy link
Collaborator

mozzy11 commented Jul 18, 2024

@josephbate can you see the build failure ??
Always make sure to run mvn spotless:apply to properly format your code otherwise the CI build will fail on un-formated code

@josephbate
Copy link
Contributor Author

oh okay


Assert.assertEquals(0, patientService.getAllPatients().size());
// save patient to the DB
String patientId = patientService.insert(pat);
Copy link
Collaborator

Choose a reason for hiding this comment

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

This function is about creating a patient.
Meaning we would have a patient created with in this fucntion

Copy link
Collaborator

Choose a reason for hiding this comment

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

And also you need to assert the number of patients before and after

Patient savedPatient = patientService.get(patientId);

Assert.assertEquals("NID45", savedPatient.getNationalId());

Copy link
Collaborator

Choose a reason for hiding this comment

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

Remove unnecesary space

String nId = "NID45";

Assert.assertEquals("John", patientService.getPatientByNationalId(nId).getPerson().getFirstName());

Copy link
Collaborator

Choose a reason for hiding this comment

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

Remove unnecesary space

String nId = "NID45";

Assert.assertEquals(1, patientService.getPatientsByNationalId(nId).size());

Copy link
Collaborator

Choose a reason for hiding this comment

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

Remove unnecesary space


Person pat = createPerson(firstName, lastname);

Assert.assertEquals(0, personService.getAllPersons().size());
Copy link
Collaborator

@mozzy11 mozzy11 Jul 18, 2024

Choose a reason for hiding this comment

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

This function is about creating a person so the should be a person created inside here

Copy link
Collaborator

Choose a reason for hiding this comment

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

Also , you need to assert the number existing persons before creating a new person

Copy link

👋 Hi, @josephbate,
Conflicts have been detected against the base branch. Please rebase your branch against the base branch.


This message is automatically generated by prince-chrismc/label-merge-conflicts-action so don't hesitate to report issues/improvements there.

@github-actions github-actions bot added the merge conflict Merge Conflicts label Jul 25, 2024
@mozzy11
Copy link
Collaborator

mozzy11 commented Aug 22, 2024

@josephbate can you resolve the merge conflicts ??

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merge conflict Merge Conflicts
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants