### Question:
BasicOrganizationClient extends ServiceManagingBaseClient implements OrganizationClient { @Override public UUID createDirectory(String name) throws CommunicationErrorException, MarshallingError, InvalidResponseException, InvalidCredentialsException, CryptographyError { final OrganizationV3DirectoriesPostRequest request = new OrganizationV3DirectoriesPostRequest(name); OrganizationV3DirectoriesPostResponse response = transport.organizationV3DirectoriesPost(request, organization); return response.getId(); } 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 createDirectorySendsNameInRequest() throws Exception { String expectedName = "Expected Name"; client.createDirectory(expectedName); ArgumentCaptor<OrganizationV3DirectoriesPostRequest> captor = ArgumentCaptor.forClass(OrganizationV3DirectoriesPostRequest.class); verify(transport).organizationV3DirectoriesPost(captor.capture(), any(EntityIdentifier.class)); assertEquals(expectedName, captor.getValue().getName()); }
@Test public void createDirectorySendsOrgEntityIdentifierInRequest() throws Exception { client.createDirectory(null); ArgumentCaptor<EntityIdentifier> captor = ArgumentCaptor.forClass(EntityIdentifier.class); verify(transport) .organizationV3DirectoriesPost(any(OrganizationV3DirectoriesPostRequest.class), captor.capture()); assertEquals(EntityIdentifier.EntityType.ORGANIZATION, captor.getValue().getType()); }
@Test public void createDirectorySendsOrgIdInEntityIdentifierInRequest() throws Exception { client.createDirectory(null); ArgumentCaptor<EntityIdentifier> captor = ArgumentCaptor.forClass(EntityIdentifier.class); verify(transport) .organizationV3DirectoriesPost(any(OrganizationV3DirectoriesPostRequest.class), captor.capture()); assertEquals(organizationId, captor.getValue().getId()); }