@@ -38,23 +38,26 @@ public class TestGcsFileSystemConfig
3838 @ Test
3939 void testDefaults ()
4040 {
41- assertRecordedDefaults (recordDefaults (GcsFileSystemConfig .class )
42- .setReadBlockSize (DataSize .of (2 , MEGABYTE ))
43- .setWriteBlockSize (DataSize .of (16 , MEGABYTE ))
44- .setPageSize (100 )
45- .setBatchSize (100 )
46- .setProjectId (null )
47- .setEndpoint (Optional .empty ())
48- .setUseGcsAccessToken (false )
49- .setAuthType (null )
50- .setJsonKey (null )
51- .setJsonKeyFilePath (null )
52- .setMaxRetries (20 )
53- .setBackoffScaleFactor (3.0 )
54- .setMaxRetryTime (new Duration (25 , SECONDS ))
55- .setMinBackoffDelay (new Duration (10 , MILLISECONDS ))
56- .setMaxBackoffDelay (new Duration (2000 , MILLISECONDS ))
57- .setApplicationId ("Trino" ));
41+ assertThatThrownBy (
42+ () -> assertRecordedDefaults (recordDefaults (GcsFileSystemConfig .class )
43+ .setReadBlockSize (DataSize .of (2 , MEGABYTE ))
44+ .setWriteBlockSize (DataSize .of (16 , MEGABYTE ))
45+ .setPageSize (100 )
46+ .setBatchSize (100 )
47+ .setProjectId (null )
48+ .setEndpoint (Optional .empty ())
49+ .setAuthType (null )
50+ .setJsonKey (null )
51+ .setJsonKeyFilePath (null )
52+ .setMaxRetries (20 )
53+ .setBackoffScaleFactor (3.0 )
54+ .setMaxRetryTime (new Duration (25 , SECONDS ))
55+ .setMinBackoffDelay (new Duration (10 , MILLISECONDS ))
56+ .setMaxBackoffDelay (new Duration (2000 , MILLISECONDS ))
57+ .setApplicationId ("Trino" )))
58+ .isInstanceOf (AssertionError .class )
59+ // use-access-token is not deprecated and isn't allowed to be set with auth-type
60+ .hasMessage ("Untested attributes: [UseGcsAccessToken]" );
5861 }
5962
6063 @ Test
@@ -102,6 +105,12 @@ void testSetUseGcsAccessTokenWithAuthType()
102105 assertThatThrownBy (() -> new GcsFileSystemConfig ().setAuthType (AuthType .DEFAULT ).setUseGcsAccessToken (false ))
103106 .isInstanceOf (IllegalArgumentException .class )
104107 .hasMessage ("Cannot set both gcs.use-access-token and gcs.auth-type" );
108+ assertThatThrownBy (() -> new GcsFileSystemConfig ().setUseGcsAccessToken (true ).setAuthType (AuthType .ACCESS_TOKEN ))
109+ .isInstanceOf (IllegalArgumentException .class )
110+ .hasMessage ("Cannot set both gcs.use-access-token and gcs.auth-type" );
111+ assertThatThrownBy (() -> new GcsFileSystemConfig ().setUseGcsAccessToken (true ).setAuthType (AuthType .DEFAULT ))
112+ .isInstanceOf (IllegalArgumentException .class )
113+ .hasMessage ("Cannot set both gcs.use-access-token and gcs.auth-type" );
105114 }
106115
107116 @ Test
0 commit comments