ExchangeRepositoryMetadata { public String getOrganizationId() { return organizationId; } ExchangeRepositoryMetadata();  ExchangeRepositoryMetadata(Credentials credentials, String uri, List<String> customDomains); Credentials getCredentials(); String getBaseUri(); String getOrganizationId();  }
@Test public void getOrganizationIdTest() { Map<String, String> uriToOrgId = buildUritoOrgIdMapping(); for (Map.Entry<String, String> entry : uriToOrgId.entrySet()) { String actualOrgId = metadata.getOrganizationId(entry.getKey()); String expectedOrgId = entry.getValue(); assertThat("Organization id is not the expected", actualOrgId, equalTo(expectedOrgId)); } }
@Test public void getOrganizationIdNullTest() { expectedException.expect(IllegalArgumentException.class); expectedException.expectMessage("URI should not be null"); metadata.getOrganizationId(null); }
@Test public void getOrganizationIdNotParseableTest() { expectedException.expect(IllegalArgumentException.class); expectedException.expectMessage("The URI https: metadata.getOrganizationId(NOT_EXCHANGE_RELATED_URI); }