yuqi1129 commented on code in PR #3975:
URL: https://github.com/apache/gravitino/pull/3975#discussion_r1665212377
##########
catalogs/catalog-hadoop/src/test/java/com/datastrato/gravitino/catalog/hadoop/TestHadoopCatalogOperations.java:
##########
@@ -118,28 +130,66 @@ public PropertiesMetadata topicPropertiesMetadata()
throws UnsupportedOperationE
@BeforeAll
public static void setUp() {
Config config = Mockito.mock(Config.class);
- Mockito.when(config.get(ENTITY_STORE)).thenReturn("kv");
-
Mockito.when(config.get(ENTITY_KV_STORE)).thenReturn(DEFAULT_ENTITY_KV_STORE);
- Mockito.when(config.get(Configs.ENTITY_SERDE)).thenReturn("proto");
-
Mockito.when(config.get(ENTITY_KV_ROCKSDB_BACKEND_PATH)).thenReturn(ROCKS_DB_STORE_PATH);
-
- Assertions.assertEquals(ROCKS_DB_STORE_PATH,
config.get(ENTITY_KV_ROCKSDB_BACKEND_PATH));
-
Mockito.when(config.get(STORE_TRANSACTION_MAX_SKEW_TIME)).thenReturn(1000L);
- Mockito.when(config.get(STORE_DELETE_AFTER_TIME)).thenReturn(20 * 60 *
1000L);
+ when(config.get(ENTITY_STORE)).thenReturn(RELATIONAL_ENTITY_STORE);
+
when(config.get(ENTITY_RELATIONAL_STORE)).thenReturn(DEFAULT_ENTITY_RELATIONAL_STORE);
+
when(config.get(ENTITY_RELATIONAL_JDBC_BACKEND_PATH)).thenReturn(STORE_PATH);
+
+ // The following properties are used to create the JDBC connection; they
are just for test, in
+ // the real world,
+ // they will be set automatically by the configuration file if you set
ENTITY_RELATIONAL_STORE
+ // as EMBEDDED_ENTITY_RELATIONAL_STORE.
+ when(config.get(ENTITY_RELATIONAL_JDBC_BACKEND_URL))
+ .thenReturn(String.format("jdbc:h2:%s;DB_CLOSE_DELAY=-1;MODE=MYSQL",
STORE_PATH));
Review Comment:
This is not IT, but a unit test. The test needs to start the entity store
and I need to provide the necessary parameter.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]