3232package com .google .auth .mtls ;
3333
3434import static org .junit .Assert .assertEquals ;
35- import static org .junit .Assert .assertFalse ;
36- import static org .junit .Assert .assertNull ;
3735import static org .junit .Assert .assertThrows ;
3836import static org .junit .Assert .assertTrue ;
3937
@@ -113,16 +111,15 @@ public void testGetKeyStoreNonZeroExitCode()
113111 assertThrows (
114112 IOException .class ,
115113 () -> SecureConnectProvider .getKeyStore (metadata , new TestProcessProvider (1 )));
116- assertTrue ("expected to fail with nonzero exit code" ,
114+ assertTrue (
115+ "expected to fail with nonzero exit code" ,
117116 actual .getMessage ().contains ("Cert provider command failed with exit code: 1" ));
118117 }
119118
120119 @ Test
121120 public void testExtractCertificateProviderCommand () throws IOException {
122121 InputStream inputStream =
123- this .getClass ()
124- .getClassLoader ()
125- .getResourceAsStream ("mtls_context_aware_metadata.json" );
122+ this .getClass ().getClassLoader ().getResourceAsStream ("mtls_context_aware_metadata.json" );
126123 List <String > command = SecureConnectProvider .extractCertificateProviderCommand (inputStream );
127124 assertEquals (2 , command .size ());
128125 assertEquals ("some_binary" , command .get (0 ));
@@ -143,19 +140,20 @@ public void testRunCertificateProviderCommandTimeout() throws InterruptedExcepti
143140 assertThrows (
144141 IOException .class ,
145142 () -> SecureConnectProvider .runCertificateProviderCommand (certCommandProcess , 100 ));
146- assertTrue ("expected to fail with timeout" ,
143+ assertTrue (
144+ "expected to fail with timeout" ,
147145 actual .getMessage ().contains ("cert provider command timed out" ));
148146 }
149147
150148 @ Test
151- public void testGetKeyStore_FileNotFoundException () throws IOException , GeneralSecurityException , InterruptedException {
152- SecureConnectProvider provider = new SecureConnectProvider (new TestProcessProvider (0 ), "/invalid/metadata/path.json" );
149+ public void testGetKeyStore_FileNotFoundException ()
150+ throws IOException , GeneralSecurityException , InterruptedException {
151+ SecureConnectProvider provider =
152+ new SecureConnectProvider (new TestProcessProvider (0 ), "/invalid/metadata/path.json" );
153153
154- CertificateSourceUnavailableException exception = assertThrows (
155- CertificateSourceUnavailableException .class ,
156- provider ::getKeyStore
157- );
154+ CertificateSourceUnavailableException exception =
155+ assertThrows (CertificateSourceUnavailableException .class , provider ::getKeyStore );
158156
159157 assertEquals ("SecureConnect metadata does not exist." , exception .getMessage ());
160158 }
161- }
159+ }
0 commit comments