@Test public void profilesAreEmpty_ProvidesNullRegion() { when(configLoader.loadProfiles(any(File.class))) .thenReturn(new AllProfiles(new HashMap<String, BasicProfile>())); assertNull(regionProvider.getRegion()); }
@Override public String getRegion() throws SdkClientException { File configFile = locationProvider.getLocation(); if (configFile != null && configFile.exists()) { BasicProfile profile = loadProfile(configFile); if (profile != null && !StringUtils.isNullOrEmpty(profile.getRegion())) { return profile.getRegion(); } } return null; }
AwsProfileRegionProvider extends AwsRegionProvider { @Override public String getRegion() throws SdkClientException { File configFile = locationProvider.getLocation(); if (configFile != null && configFile.exists()) { BasicProfile profile = loadProfile(configFile); if (profile != null && !StringUtils.isNullOrEmpty(profile.getRegion())) { return profile.getRegion(); } } return null; } }
AwsProfileRegionProvider extends AwsRegionProvider { @Override public String getRegion() throws SdkClientException { File configFile = locationProvider.getLocation(); if (configFile != null && configFile.exists()) { BasicProfile profile = loadProfile(configFile); if (profile != null && !StringUtils.isNullOrEmpty(profile.getRegion())) { return profile.getRegion(); } } return null; } AwsProfileRegionProvider();  AwsProfileRegionProvider(String profileName); @SdkTestInternalApi  AwsProfileRegionProvider(String profileName, AwsProfileFileLocationProvider locationProvider,
                             BasicProfileConfigLoader configLoader); }
AwsProfileRegionProvider extends AwsRegionProvider { @Override public String getRegion() throws SdkClientException { File configFile = locationProvider.getLocation(); if (configFile != null && configFile.exists()) { BasicProfile profile = loadProfile(configFile); if (profile != null && !StringUtils.isNullOrEmpty(profile.getRegion())) { return profile.getRegion(); } } return null; } AwsProfileRegionProvider();  AwsProfileRegionProvider(String profileName); @SdkTestInternalApi  AwsProfileRegionProvider(String profileName, AwsProfileFileLocationProvider locationProvider,
                             BasicProfileConfigLoader configLoader); @Override String getRegion(); }
AwsProfileRegionProvider extends AwsRegionProvider { @Override public String getRegion() throws SdkClientException { File configFile = locationProvider.getLocation(); if (configFile != null && configFile.exists()) { BasicProfile profile = loadProfile(configFile); if (profile != null && !StringUtils.isNullOrEmpty(profile.getRegion())) { return profile.getRegion(); } } return null; } AwsProfileRegionProvider();  AwsProfileRegionProvider(String profileName); @SdkTestInternalApi  AwsProfileRegionProvider(String profileName, AwsProfileFileLocationProvider locationProvider,
                             BasicProfileConfigLoader configLoader); @Override String getRegion();  }