AwsClientBuilder { public final Subclass withRegion(Regions region) { return withRegion(region.getName()); } protected  AwsClientBuilder(ClientConfigurationFactory clientConfigFactory); @SdkTestInternalApi protected  AwsClientBuilder(ClientConfigurationFactory clientConfigFactory,
                               AwsRegionProvider regionProvider); final AWSCredentialsProvider getCredentials(); final void setCredentials(AWSCredentialsProvider credentialsProvider); final Subclass withCredentials(AWSCredentialsProvider credentialsProvider); final ClientConfiguration getClientConfiguration(); final void setClientConfiguration(ClientConfiguration config); final Subclass withClientConfiguration(ClientConfiguration config); final RequestMetricCollector getMetricsCollector(); final void setMetricsCollector(RequestMetricCollector metrics); final Subclass withMetricsCollector(RequestMetricCollector metrics); final String getRegion(); final void setRegion(String region); final Subclass withRegion(Regions region); final Subclass withRegion(String region); final EndpointConfiguration getEndpoint(); final void setEndpointConfiguration(EndpointConfiguration endpointConfiguration); final Subclass withEndpointConfiguration(EndpointConfiguration endpointConfiguration); final List<RequestHandler2> getRequestHandlers(); final void setRequestHandlers(RequestHandler2... handlers); final Subclass withRequestHandlers(RequestHandler2... handlers); final MonitoringListener getMonitoringListener(); final void setMonitoringListener(MonitoringListener monitoringListener); final Subclass withMonitoringListener(MonitoringListener monitoringListener); CsmConfigurationProvider getClientSideMonitoringConfigurationProvider(); void setClientSideMonitoringConfigurationProvider(CsmConfigurationProvider csmConfig); Subclass withClientSideMonitoringConfigurationProvider(
            CsmConfigurationProvider csmConfig); abstract TypeToBuild build();  }
@Test public void regionProvidedExplicitly_WhenRegionNotFoundInMetadata_ThrowsIllegalArgumentException() throws Exception { try { RegionUtils.initializeWithMetadata(new RegionMetadata(Mockito.mock(RegionMetadataProvider.class))); new ConcreteAsyncBuilder().withRegion(Regions.AP_NORTHEAST_1); fail("Expected SdkClientException"); } catch (SdkClientException e) { assertThat(e.getMessage(), containsString("Could not find region information")); } finally { RegionUtils.initialize(); } }