Skip to content

Commit

Permalink
Merge pull request #604 from PierreBtz/pbeitz/fix-test
Browse files Browse the repository at this point in the history
  • Loading branch information
PierreBtz authored Jul 24, 2023
2 parents e06afa9 + 5039db0 commit 5bef289
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions src/test/java/org/zendesk/client/v2/RealSmokeTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -1795,15 +1795,23 @@ public void createOrganizationMemberships() throws Exception {

@Test
public void lookupOrganizationByExternalId() throws Exception {
String orgId = "i";
createClientWithTokenOrPassword();

Organization newOrganization = newTestOrganization();
newOrganization.setExternalId("i");
Organization resultOrganization = instance.createOrganization(newOrganization);
assertNotNull(resultOrganization);
newOrganization.setExternalId(orgId);
Organization resultOrganization = null;
try {
resultOrganization = instance.createOrganization(newOrganization);
assertNotNull(resultOrganization);

Iterable<Organization> or = instance.lookupOrganizationsByExternalId("i");
assertEquals(1, StreamSupport.stream(or.spliterator(), false).count());
Iterable<Organization> or = instance.lookupOrganizationsByExternalId(orgId);
assertEquals(1, StreamSupport.stream(or.spliterator(), false).count());
} finally {
if (resultOrganization != null) {
instance.deleteOrganization(resultOrganization);
}
}

assertThrows(
IllegalArgumentException.class, () -> instance.lookupOrganizationsByExternalId(""));
Expand Down

0 comments on commit 5bef289

Please sign in to comment.