### Question:
BasicOrganizationClient extends ServiceManagingBaseClient implements OrganizationClient { @Override public List<Directory> getAllDirectories() throws PlatformErrorException, UnknownEntityException, InvalidResponseException, InvalidStateException, InvalidCredentialsException, CommunicationErrorException, MarshallingError, CryptographyError { OrganizationV3DirectoriesGetResponse response = transport.organizationV3DirectoriesGet(organization); List<Directory> directories = new ArrayList<>(); for (OrganizationV3DirectoriesGetResponseDirectory responseDirectory : response.getDirectories()) { directories.add(new Directory(responseDirectory.getId(), responseDirectory.getName(), responseDirectory.isActive(), responseDirectory.getServiceIds(), responseDirectory.getSdkKeys(), responseDirectory.getAndroidKey(), responseDirectory.getIosCertificateFingerprint(), responseDirectory.isDenialContextInquiryEnabled(), responseDirectory.getWebhookUrl())); } return directories; } BasicOrganizationClient(UUID organizationId, Transport transport); @Override UUID createDirectory(String name); @Override void updateDirectory(UUID directoryId, Boolean active, String androidKey, String iosP12,
                                Boolean denialContextInquiryEnabled, URI webhookUrl); @Override void updateDirectory(UUID directoryId, Boolean active, String androidKey, String iosP12,
                                Boolean denialContextInquiryEnabled); @Override void updateDirectory(UUID directoryId, Boolean active, String androidKey, String iosP12); @Override Directory getDirectory(UUID directoryId); @Override List<Directory> getDirectories(List<UUID> directoryIds); @Override List<Directory> getAllDirectories(); @Override UUID generateAndAddDirectorySdkKey(UUID directoryId); @Override void removeDirectorySdkKey(UUID directoryId, UUID sdkKey); @Override List<UUID> getAllDirectorySdkKeys(UUID directoryId); @Override List<PublicKey> getDirectoryPublicKeys(UUID directoryId); @Override String addDirectoryPublicKey(UUID directoryId, RSAPublicKey publicKey, Boolean active, Date expires); @Override void updateDirectoryPublicKey(UUID directoryId, String keyId, Boolean active, Date expires); @Override void removeDirectoryPublicKey(UUID directoryId, String keyId); @Override UUID createService(String name, String description, URI icon, URI callbackURL, Boolean active); @Override void updateService(UUID serviceId, String name, String description, URI icon, URI callbackURL, Boolean active); @Override Service getService(UUID serviceId); @Override List<Service> getServices(List<UUID> serviceIds); @Override List<Service> getAllServices(); @Override List<PublicKey> getServicePublicKeys(UUID serviceId); @Override String addServicePublicKey(UUID serviceId, RSAPublicKey publicKey, Boolean active, Date expires); @Override void updateServicePublicKey(UUID serviceId, String keyId, Boolean active, Date expires); @Override void removeServicePublicKey(UUID serviceId, String keyId); @Override @Deprecated ServicePolicy getServicePolicy(UUID serviceId); @Override @Deprecated void setServicePolicy(UUID serviceId, ServicePolicy policy); @Override Policy getAdvancedServicePolicy(UUID serviceId); @Override void setAdvancedServicePolicy(UUID serviceId, Policy policy); @Override void removeServicePolicy(UUID serviceId);  }### Answer:
@Test public void getAllDirectoriesSendsOrgEntityIdentifierInRequest() throws Exception { client.getAllDirectories(); ArgumentCaptor<EntityIdentifier> captor = ArgumentCaptor.forClass(EntityIdentifier.class); verify(transport).organizationV3DirectoriesGet(captor.capture()); assertEquals(EntityIdentifier.EntityType.ORGANIZATION, captor.getValue().getType()); }
@Test public void getAllDirectoriesSendsOrgIdInEntityIdentifierInRequest() throws Exception { client.getAllDirectories(); ArgumentCaptor<EntityIdentifier> captor = ArgumentCaptor.forClass(EntityIdentifier.class); verify(transport).organizationV3DirectoriesGet(captor.capture()); assertEquals(organizationId, captor.getValue().getId()); }