File tree Expand file tree Collapse file tree 1 file changed +13
-5
lines changed
src/test/java/org/zendesk/client/v2 Expand file tree Collapse file tree 1 file changed +13
-5
lines changed Original file line number Diff line number Diff line change @@ -1795,15 +1795,23 @@ public void createOrganizationMemberships() throws Exception {
17951795
17961796 @ Test
17971797 public void lookupOrganizationByExternalId () throws Exception {
1798+ String orgId = "i" ;
17981799 createClientWithTokenOrPassword ();
17991800
18001801 Organization newOrganization = newTestOrganization ();
1801- newOrganization .setExternalId ("i" );
1802- Organization resultOrganization = instance .createOrganization (newOrganization );
1803- assertNotNull (resultOrganization );
1802+ newOrganization .setExternalId (orgId );
1803+ Organization resultOrganization = null ;
1804+ try {
1805+ resultOrganization = instance .createOrganization (newOrganization );
1806+ assertNotNull (resultOrganization );
18041807
1805- Iterable <Organization > or = instance .lookupOrganizationsByExternalId ("i" );
1806- assertEquals (1 , StreamSupport .stream (or .spliterator (), false ).count ());
1808+ Iterable <Organization > or = instance .lookupOrganizationsByExternalId (orgId );
1809+ assertEquals (1 , StreamSupport .stream (or .spliterator (), false ).count ());
1810+ } finally {
1811+ if (resultOrganization != null ) {
1812+ instance .deleteOrganization (resultOrganization );
1813+ }
1814+ }
18071815
18081816 assertThrows (
18091817 IllegalArgumentException .class , () -> instance .lookupOrganizationsByExternalId ("" ));
You can’t perform that action at this time.
0 commit comments