|
31 | 31 | import static io.airlift.units.DataSize.Unit.MEGABYTE;
|
32 | 32 | import static java.util.concurrent.TimeUnit.MILLISECONDS;
|
33 | 33 | import static java.util.concurrent.TimeUnit.SECONDS;
|
34 |
| -import static org.assertj.core.api.Assertions.assertThatThrownBy; |
35 | 34 |
|
36 | 35 | public class TestGcsFileSystemConfig
|
37 | 36 | {
|
38 | 37 | @Test
|
39 | 38 | void testDefaults()
|
40 | 39 | {
|
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(AuthType.DEFAULT) |
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 now deprecated and isn't allowed to be set with auth-type |
60 |
| - .hasMessage("Untested attributes: [UseGcsAccessToken]"); |
| 40 | + assertRecordedDefaults(recordDefaults(GcsFileSystemConfig.class) |
| 41 | + .setReadBlockSize(DataSize.of(2, MEGABYTE)) |
| 42 | + .setWriteBlockSize(DataSize.of(16, MEGABYTE)) |
| 43 | + .setPageSize(100) |
| 44 | + .setBatchSize(100) |
| 45 | + .setUseGcsAccessToken(false) |
| 46 | + .setProjectId(null) |
| 47 | + .setEndpoint(Optional.empty()) |
| 48 | + .setAuthType(AuthType.DEFAULT) |
| 49 | + .setJsonKey(null) |
| 50 | + .setJsonKeyFilePath(null) |
| 51 | + .setMaxRetries(20) |
| 52 | + .setBackoffScaleFactor(3.0) |
| 53 | + .setMaxRetryTime(new Duration(25, SECONDS)) |
| 54 | + .setMinBackoffDelay(new Duration(10, MILLISECONDS)) |
| 55 | + .setMaxBackoffDelay(new Duration(2000, MILLISECONDS)) |
| 56 | + .setApplicationId("Trino")); |
61 | 57 | }
|
62 | 58 |
|
63 | 59 | @Test
|
@@ -187,16 +183,16 @@ public void testValidation()
|
187 | 183 |
|
188 | 184 | assertFailsValidation(
|
189 | 185 | new GcsFileSystemConfig()
|
190 |
| - .setAuthType(AuthType.DEFAULT) |
191 |
| - .setUseGcsAccessToken(true), |
| 186 | + .setUseGcsAccessToken(true) |
| 187 | + .setAuthType(AuthType.DEFAULT), |
192 | 188 | "authTypeAndUseGcsAccessTokenMutuallyExclusive",
|
193 | 189 | "Cannot set both gcs.use-access-token and gcs.auth-type",
|
194 | 190 | AssertTrue.class);
|
195 | 191 |
|
196 | 192 | assertFailsValidation(
|
197 | 193 | new GcsFileSystemConfig()
|
198 |
| - .setAuthType(AuthType.DEFAULT) |
199 |
| - .setUseGcsAccessToken(false), |
| 194 | + .setUseGcsAccessToken(false) |
| 195 | + .setAuthType(AuthType.DEFAULT), |
200 | 196 | "authTypeAndUseGcsAccessTokenMutuallyExclusive",
|
201 | 197 | "Cannot set both gcs.use-access-token and gcs.auth-type",
|
202 | 198 | AssertTrue.class);
|
|
0 commit comments