### Question:
TenantRestClient extends RestClient implements TenantClient { @Override public List<TenantSpecification> getTenants() throws IOException { return getAll(TENANT_URL_SUFFIX, TENANTS_LIST_TYPE); } TenantRestClient(Supplier<RestClientConnectionConfig> config, CloseableHttpClient httpClient);  TenantRestClient(Supplier<RestClientConnectionConfig> config, CloseableHttpClient httpClient, Gson gson); @Override List<TenantSpecification> getTenants(); @Override TenantSpecification getTenant(String tenantName); @Override void deleteTenant(String tenantName);  }### Answer:
@Test public void testGetAllTenantsSuccess() throws IOException { List<TenantSpecification> result = tenantClient.getTenants(); assertEquals(TENANTS, result); }
@Test public void testGetAllTenantsBadRequest() throws IOException { clientManager = createClientManager(TestStatusUserId.BAD_REQUEST_STATUS_USER_ID.getValue()); tenantClient = clientManager.getTenantClient(); try { tenantClient.getTenants(); Assert.fail("Expected HttpFailureException"); } catch (HttpFailureException e) { Assert.assertEquals(HttpStatus.SC_BAD_REQUEST, e.getStatusCode()); } }
@Test public void testGetAllTenantsUnauthorized() throws IOException { clientManager = createClientManager(TestStatusUserId.UNAUTHORIZED_STATUS_USER_ID.getValue()); tenantClient = clientManager.getTenantClient(); try { tenantClient.getTenants(); Assert.fail("Expected UnauthorizedAccessTokenException"); } catch (UnauthorizedAccessTokenException ignored) { } }