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

Adding Unit Test for OrganizationContact #882

Open
wants to merge 7 commits into
base: develop_3x
Choose a base branch
from

Conversation

sayed4900
Copy link
Contributor

@sayed4900 sayed4900 commented Mar 24, 2024

This pull request implements a unit test for the OrganizationContact class by verifying its association with the Person and Organization classes. The test ensures that the OrganizationContact correctly stores and retrieves information about the associated Person and Organization.

Screenshot from 2024-03-24 15-30-07

@sayed4900
Copy link
Contributor Author

@mozzy11 can you review this

@mozzy11
Copy link
Collaborator

mozzy11 commented Mar 25, 2024

Thanks @sayed4900 .
These are not intergration tests.
These are unit tests

@mozzy11
Copy link
Collaborator

mozzy11 commented Mar 25, 2024

@sayed4900
Copy link
Contributor Author

Thanks @sayed4900 . These are not intergration tests. These are unit tests

I am sorry for this mistake, my confusion stemmed from the fact that I utilized data from the Person class to test the getPerson() method within the OrganizationContact class. But now it's clear for me why it is unit testing. Thanks for you @mozzy11

@sayed4900 sayed4900 changed the title Adding Integration Test for OrganizationContact Adding Unit Test for OrganizationContact Mar 25, 2024
@sayed4900
Copy link
Contributor Author

@mozzy11 should I close this pull request now?

@mozzy11
Copy link
Collaborator

mozzy11 commented Mar 25, 2024

Integration tests are designed to test the interaction between different components of a system, including external dependencies such as databases, file systems, APIs, etc. Therefore, when performing integration tests, the object being tested is not isolated from its persistence mechanism.

@mozzy11
Copy link
Collaborator

mozzy11 commented Mar 25, 2024

@sayed4900 , can you create a subfolder unitTests under src/test/java/org/openelisglobal and move these these there

…ntact' into integration-test-organization-contact

Merge remote-tracking branch 'origin/integration-test-organization-contact' into integration-test-organization-contact

This merge incorporates changes from the remote repository into the local branch to synchronize our work with the latest updates.
@sayed4900
Copy link
Contributor Author

@sayed4900 , can you create a subfolder unitTests under src/test/java/org/openelisglobal and move these these there

I create unitTests and under it I create organization folder, this good? or should I add all unit tests on this folder unitTestsdirectly ? I add folder organization to be organized as there are unit tests for address classes

}

@Test
public void testOrganizationContactIntegration() {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Thanks @sayed4900 for attemtoing this.
For consistence ,
test methods should follow a naming convetion like
MethodName_ExpectedBehavior ie getOrganization_shouldReturnOrganization

Copy link
Collaborator

@mozzy11 mozzy11 left a comment

Choose a reason for hiding this comment

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

Use a consistent naming convetion ie MethodName_ExpectedBehavior for the test Methods

@sayed4900
Copy link
Contributor Author

Use a consistent naming convetion ie MethodName_ExpectedBehavior for the test Methods

Thanks @mozzy11
I will do it

@sayed4900
Copy link
Contributor Author

Use a consistent naming convetion ie MethodName_ExpectedBehavior for the test Methods

Thanks @mozzy11 I will do it

Done

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.

2 participants