snuyanzin commented on code in PR #26385:
URL: https://github.com/apache/flink/pull/26385#discussion_r2031822785
##########
flink-table/flink-table-api-java/src/test/java/org/apache/flink/table/api/TableEnvironmentTest.java:
##########
@@ -212,4 +336,39 @@ private static void
assertTemporaryCreateTableFromDescriptor(
assertThat(catalogTable.getOptions().get("connector")).isEqualTo("fake");
assertThat(catalogTable.getOptions().get("a")).isEqualTo("Test");
}
+
+ private static void assertCreateModelFromDescriptor(
+ TableEnvironmentMock tEnv, boolean ignoreIfExists) throws
ModelNotExistException {
+ final String catalog = tEnv.getCurrentCatalog();
+ final String database = tEnv.getCurrentDatabase();
+
+ if (ignoreIfExists) {
+ tEnv.createModel("M", TEST_MODEL_DESCRIPTOR, true);
+ } else {
+ tEnv.createModel("M", TEST_MODEL_DESCRIPTOR);
+ }
+
+ final ObjectPath objectPath = new ObjectPath(database, "M");
+ CatalogModel catalogModel =
+
tEnv.getCatalog(catalog).orElseThrow(AssertionError::new).getModel(objectPath);
+ assertThat(catalogModel).isInstanceOf(CatalogModel.class);
+ assertThat(catalogModel.getInputSchema()).isEqualTo(TEST_SCHEMA);
+ assertThat(catalogModel.getOptions().get("a")).isEqualTo("Test");
Review Comment:
Same here
if we extract this kind of assert into a separate method I would expect it
working with different input schemas and options, not only `Test` and
`TEST_SCHEMA`
--
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]