@@ -84,7 +84,7 @@ class FlinkCatalogTest {
8484 FlussClusterExtension .builder ().setNumOfTabletServers (1 ).build ();
8585
8686 private static final String CATALOG_NAME = "test-catalog" ;
87- private static final String DEFAULT_DB = "default" ;
87+ private static final String DEFAULT_DB = FlinkCatalogOptions . DEFAULT_DATABASE . defaultValue () ;
8888 static Catalog catalog ;
8989 private final ObjectPath tableInDefaultDb = new ObjectPath (DEFAULT_DB , "t1" );
9090
@@ -407,8 +407,7 @@ void testDatabase() throws Exception {
407407 CatalogTable expectedTable = addOptions (table , addedOptions );
408408 checkEqualsRespectSchema ((CatalogTable ) tableCreated , expectedTable );
409409 assertThat (catalog .listTables ("db1" )).isEqualTo (Collections .singletonList ("t1" ));
410- assertThat (catalog .listDatabases ())
411- .isEqualTo (Arrays .asList (DEFAULT_DB , "db1" , "db2" , "fluss" ));
410+ assertThat (catalog .listDatabases ()).isEqualTo (Arrays .asList ("db1" , "db2" , DEFAULT_DB ));
412411 // test drop db1;
413412 // should throw exception since db1 is not empty and we set cascade = false
414413 assertThatThrownBy (() -> catalog .dropDatabase ("db1" , false , false ))
@@ -424,10 +423,10 @@ void testDatabase() throws Exception {
424423 // should be ok since we set ignoreIfNotExists = true
425424 catalog .dropDatabase ("db1" , true , true );
426425 // test list db
427- assertThat (catalog .listDatabases ()).isEqualTo (Arrays .asList (DEFAULT_DB , "db2" , "fluss" ));
426+ assertThat (catalog .listDatabases ()).isEqualTo (Arrays .asList ("db2" , DEFAULT_DB ));
428427 catalog .dropDatabase ("db2" , false , true );
429428 // should be empty
430- assertThat (catalog .listDatabases ()).isEqualTo (Arrays . asList (DEFAULT_DB , "fluss" ));
429+ assertThat (catalog .listDatabases ()).isEqualTo (Collections . singletonList (DEFAULT_DB ));
431430 // should throw exception since the db is not exist and we set ignoreIfNotExists = false
432431 assertThatThrownBy (() -> catalog .listTables ("unknown" ))
433432 .isInstanceOf (DatabaseNotExistException .class )
@@ -465,7 +464,7 @@ void testOperatePartitions() throws Exception {
465464 catalog .createTable (path1 , table , false );
466465 assertThatThrownBy (() -> catalog .listPartitions (path1 ))
467466 .isInstanceOf (TableNotPartitionedException .class )
468- .hasMessage ("Table default .t1 in catalog test-catalog is not partitioned." );
467+ .hasMessage ("Table fluss .t1 in catalog test-catalog is not partitioned." );
469468
470469 // create partition table and list partitions.
471470 ObjectPath path2 = new ObjectPath (DEFAULT_DB , "partitioned_t1" );
@@ -501,7 +500,7 @@ void testOperatePartitions() throws Exception {
501500 assertThatThrownBy (() -> catalog .listPartitions (path2 , invalidTestSpec ))
502501 .isInstanceOf (CatalogException .class )
503502 .hasMessage (
504- "Failed to list partitions of table default .partitioned_t1 in test-catalog, by partitionSpec CatalogPartitionSpec{{second=}}" );
503+ "Failed to list partitions of table fluss .partitioned_t1 in test-catalog, by partitionSpec CatalogPartitionSpec{{second=}}" );
505504
506505 // NEW: Test dropPartition functionality
507506 CatalogPartitionSpec firstPartSpec = catalogPartitionSpecs .get (0 );
@@ -520,7 +519,7 @@ void testOperatePartitions() throws Exception {
520519 .isInstanceOf (
521520 org .apache .flink .table .catalog .exceptions .PartitionNotExistException .class )
522521 .hasMessage (
523- "Partition CatalogPartitionSpec{{first=999}} of table default .partitioned_t1 in catalog test-catalog does not exist." );
522+ "Partition CatalogPartitionSpec{{first=999}} of table fluss .partitioned_t1 in catalog test-catalog does not exist." );
524523
525524 // Should not throw with ignoreIfNotExists = true
526525 catalog .dropPartition (path2 , nonExistentSpec , true );
0 commit comments