File tree Expand file tree Collapse file tree
google-auth-library-java/oauth2_http/javatests/com/google/auth/mtls Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -101,6 +101,21 @@ public String getProperty(String name, String def) {
101101 () -> MtlsUtils .getCertificatePath (envProvider , propProvider , configFile .toString ()));
102102 }
103103
104+ @ Test
105+ void getCertificatePath_ecpOnlyConfig_throwsCertificateSourceUnavailableException ()
106+ throws IOException {
107+ Path configFile = tempDir .resolve ("ecp_config.json" );
108+ Files .write (
109+ configFile , "{\" cert_configs\" :{\" enterprise_certificates\" :{\" libs\" :[]}}}" .getBytes ());
110+
111+ EnvironmentProvider envProvider = name -> null ;
112+ PropertyProvider propProvider = (name , def ) -> def ;
113+
114+ assertThrows (
115+ CertificateSourceUnavailableException .class ,
116+ () -> MtlsUtils .getCertificatePath (envProvider , propProvider , configFile .toString ()));
117+ }
118+
104119 @ Test
105120 void getWorkloadCertificateConfiguration_overridePath () throws IOException {
106121 Path configFile = tempDir .resolve ("custom_config.json" );
You can’t perform that action at this time.
0 commit comments