@@ -126,7 +126,7 @@ public class PolarisRestCatalogIntegrationTest extends CatalogTests<RESTCatalog>
126126 private CatalogApi catalogApi ;
127127 private RESTCatalog restCatalog ;
128128 private String currentCatalogName ;
129- private String [] restCatalogConfig ;
129+ private Map < String , String > restCatalogConfig ;
130130
131131 private final String catalogBaseLocation =
132132 s3BucketBase + "/" + System .getenv ("USER" ) + "/path/to/data" ;
@@ -218,7 +218,19 @@ public void before(TestInfo testInfo) {
218218 .getTestMethod ()
219219 .map (m -> m .getAnnotation (RestCatalogConfig .class ))
220220 .map (RestCatalogConfig ::value )
221- .orElse (new String [0 ]);
221+ .map (
222+ values -> {
223+ if (values .length % 2 != 0 ) {
224+ throw new IllegalArgumentException (
225+ String .format ("Missing value for config '%s'" , values [values .length - 1 ]));
226+ }
227+ Map <String , String > config = new HashMap <>();
228+ for (int i = 0 ; i < values .length ; i += 2 ) {
229+ config .put (values [i ], values [i + 1 ]);
230+ }
231+ return config ;
232+ })
233+ .orElse (ImmutableMap .of ());
222234
223235 restCatalog = initCatalog (currentCatalogName , ImmutableMap .of ());
224236 }
@@ -243,9 +255,7 @@ protected RESTCatalog catalog() {
243255 @ Override
244256 protected RESTCatalog initCatalog (String catalogName , Map <String , String > additionalProperties ) {
245257 ImmutableMap .Builder <String , String > extraPropertiesBuilder = ImmutableMap .builder ();
246- for (int i = 0 ; i < restCatalogConfig .length ; i += 2 ) {
247- extraPropertiesBuilder .put (restCatalogConfig [i ], restCatalogConfig [i + 1 ]);
248- }
258+ extraPropertiesBuilder .putAll (restCatalogConfig );
249259 extraPropertiesBuilder .putAll (additionalProperties );
250260 return IcebergHelper .restCatalog (
251261 client ,
0 commit comments