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

fix: Remove length constraint from organization external id lookup #597

Conversation

enismustafaj
Copy link
Contributor

No description provided.

Copy link
Collaborator

@PierreBtz PierreBtz left a comment

Choose a reason for hiding this comment

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

I don't see any trace in the Zendesk documentation, nor in this repository history, explaining why this limitation was added.

I suppose it's therefore ok to lift it, but I'd like to have a test cover this use case.

@enismustafaj
Copy link
Contributor Author

@PierreBtz Thank you having a look at this! I added the test case when the external Id is empty.

@enismustafaj enismustafaj requested a review from PierreBtz July 13, 2023 12:45
Copy link
Collaborator

@PierreBtz PierreBtz left a comment

Choose a reason for hiding this comment

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

Change looks good, I'd like for the test to be more precise in its assertion. Proposed something, please tell me what you think about it.

assertNotNull(resultOrganization);

Iterable<Organization> or = instance.lookupOrganizationsByExternalId("i");
assertTrue(or.iterator().hasNext());
Copy link
Collaborator

Choose a reason for hiding this comment

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

Only makes sure something is returned, we should also make sure the size is ok, what about the following?

Suggested change
assertTrue(or.iterator().hasNext());
assertEquals(1, StreamSupport.stream(or.spliterator(), false).count());

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added the change in the test.

@PierreBtz PierreBtz added the bug label Jul 24, 2023
@enismustafaj enismustafaj requested a review from PierreBtz July 24, 2023 13:32
Copy link
Collaborator

@PierreBtz PierreBtz left a comment

Choose a reason for hiding this comment

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

alright, perfect, thanks!

@PierreBtz PierreBtz merged commit ac92f34 into cloudbees-oss:master Jul 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
3 participants