@@ -244,9 +244,9 @@ public String getProperty(String name, String def) {
244244 assertEquals ("APPDATA environment variable is not set on Windows." , exception .getMessage ());
245245 }
246246
247- // If client certificate usage is explicitly disabled, canMtlsBeEnabled should return false.
247+ // If client certificate usage is explicitly disabled, canBeEnabled should return false.
248248 @ Test
249- void canMtlsBeEnabled_allowanceExplicitFalse_returnsFalse () throws IOException {
249+ void canBeEnabled_allowanceExplicitFalse_returnsFalse () throws IOException {
250250 EnvironmentProvider envProvider =
251251 new EnvironmentProvider () {
252252 @ Override
@@ -259,13 +259,13 @@ public String getEnv(String name) {
259259 };
260260 PropertyProvider propProvider = (name , def ) -> def ;
261261
262- assertFalse (MtlsUtils .canMtlsBeEnabled (envProvider , propProvider , null ));
262+ assertFalse (MtlsUtils .canBeEnabled (envProvider , propProvider , null ));
263263 }
264264
265265 // If client certificate usage is explicitly enabled and a valid configuration is present,
266- // canMtlsBeEnabled should return true.
266+ // canBeEnabled should return true.
267267 @ Test
268- void canMtlsBeEnabled_allowanceExplicitTrue_withConfig_returnsTrue () throws IOException {
268+ void canBeEnabled_allowanceExplicitTrue_withConfig_returnsTrue () throws IOException {
269269 EnvironmentProvider envProvider =
270270 new EnvironmentProvider () {
271271 @ Override
@@ -281,13 +281,13 @@ public String getEnv(String name) {
281281 };
282282 PropertyProvider propProvider = (name , def ) -> def ;
283283
284- assertTrue (MtlsUtils .canMtlsBeEnabled (envProvider , propProvider , null ));
284+ assertTrue (MtlsUtils .canBeEnabled (envProvider , propProvider , null ));
285285 }
286286
287287 // If client certificate usage is unset but a valid configuration is present, mTLS should be
288288 // enabled by default (returns true).
289289 @ Test
290- void canMtlsBeEnabled_allowanceUnset_withConfig_returnsTrue () throws IOException {
290+ void canBeEnabled_allowanceUnset_withConfig_returnsTrue () throws IOException {
291291 EnvironmentProvider envProvider =
292292 new EnvironmentProvider () {
293293 @ Override
@@ -300,13 +300,13 @@ public String getEnv(String name) {
300300 };
301301 PropertyProvider propProvider = (name , def ) -> def ;
302302
303- assertTrue (MtlsUtils .canMtlsBeEnabled (envProvider , propProvider , null ));
303+ assertTrue (MtlsUtils .canBeEnabled (envProvider , propProvider , null ));
304304 }
305305
306306 // If the GOOGLE_API_CERTIFICATE_CONFIG environment variable points to a non-existent file,
307- // canMtlsBeEnabled should throw an IOException.
307+ // canBeEnabled should throw an IOException.
308308 @ Test
309- void canMtlsBeEnabled_envVarConfigMissingFile_throwsIOException () throws IOException {
309+ void canBeEnabled_envVarConfigMissingFile_throwsIOException () throws IOException {
310310 Path nonExistentConfig = tempDir .resolve ("non_existent.json" );
311311 EnvironmentProvider envProvider =
312312 new EnvironmentProvider () {
@@ -321,13 +321,13 @@ public String getEnv(String name) {
321321 PropertyProvider propProvider = (name , def ) -> def ;
322322
323323 assertThrows (
324- IOException .class , () -> MtlsUtils .canMtlsBeEnabled (envProvider , propProvider , null ));
324+ IOException .class , () -> MtlsUtils .canBeEnabled (envProvider , propProvider , null ));
325325 }
326326
327- // If the well-known gcloud certificate configuration file exists, canMtlsBeEnabled should return
327+ // If the well-known gcloud certificate configuration file exists, canBeEnabled should return
328328 // true.
329329 @ Test
330- void canMtlsBeEnabled_wellKnownConfigExists_returnsTrue () throws IOException {
330+ void canBeEnabled_wellKnownConfigExists_returnsTrue () throws IOException {
331331 Path gcloudDir = tempDir .resolve (".config/gcloud" );
332332 Files .createDirectories (gcloudDir );
333333 Path configFile = gcloudDir .resolve ("certificate_config.json" );
@@ -348,11 +348,11 @@ public String getProperty(String name, String def) {
348348 }
349349 };
350350
351- assertTrue (MtlsUtils .canMtlsBeEnabled (envProvider , propProvider , null ));
351+ assertTrue (MtlsUtils .canBeEnabled (envProvider , propProvider , null ));
352352 }
353353
354354 @ Test
355- void canMtlsBeEnabled_alwaysPolicy_clientCertDisabled_throwsException () {
355+ void canBeEnabled_alwaysPolicy_clientCertDisabled_throwsException () {
356356 EnvironmentProvider envProvider =
357357 name -> {
358358 if ("GOOGLE_API_USE_CLIENT_CERTIFICATE" .equals (name )) {
@@ -367,7 +367,7 @@ void canMtlsBeEnabled_alwaysPolicy_clientCertDisabled_throwsException() {
367367
368368 assertThrows (
369369 CertificateSourceUnavailableException .class ,
370- () -> MtlsUtils .canMtlsBeEnabled (envProvider , propProvider , null ));
370+ () -> MtlsUtils .canBeEnabled (envProvider , propProvider , null ));
371371 }
372372
373373 @ Test
@@ -395,7 +395,7 @@ void getMtlsEndpointUsagePolicy_auto() {
395395 }
396396
397397 @ Test
398- void canMtlsBeEnabled_policyNever_returnsFalse () throws IOException {
398+ void canBeEnabled_policyNever_returnsFalse () throws IOException {
399399 EnvironmentProvider envProvider =
400400 new EnvironmentProvider () {
401401 @ Override
@@ -411,7 +411,7 @@ public String getEnv(String name) {
411411 };
412412 PropertyProvider propProvider = (name , def ) -> def ;
413413
414- assertFalse (MtlsUtils .canMtlsBeEnabled (envProvider , propProvider , null ));
414+ assertFalse (MtlsUtils .canBeEnabled (envProvider , propProvider , null ));
415415 }
416416
417417 private String createJsonConfigString (Path certPath , Path keyPath ) {
0 commit comments