hackergin commented on code in PR #24844: URL: https://github.com/apache/flink/pull/24844#discussion_r1616519135
########## flink-table/flink-sql-gateway/src/test/java/org/apache/flink/table/gateway/rest/SqlGatewayRestEndpointMaterializedTableITCase.java: ########## @@ -0,0 +1,129 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.flink.table.gateway.rest; + +import org.apache.flink.table.catalog.ObjectIdentifier; +import org.apache.flink.table.data.RowData; +import org.apache.flink.table.gateway.AbstractMaterializedTableStatementITCase; +import org.apache.flink.table.gateway.api.operation.OperationHandle; +import org.apache.flink.table.gateway.rest.handler.AbstractSqlGatewayRestHandler; +import org.apache.flink.table.gateway.rest.header.materializedtable.RefreshMaterializedTableHeaders; +import org.apache.flink.table.gateway.rest.message.materializedtable.RefreshMaterializedTableParameters; +import org.apache.flink.table.gateway.rest.message.materializedtable.RefreshMaterializedTableRequestBody; +import org.apache.flink.table.gateway.rest.message.materializedtable.RefreshMaterializedTableResponseBody; +import org.apache.flink.table.gateway.rest.util.SqlGatewayRestEndpointExtension; +import org.apache.flink.table.gateway.rest.util.TestingRestClient; +import org.apache.flink.table.planner.factories.TestValuesTableFactory; +import org.apache.flink.types.Row; + +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Order; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.RegisterExtension; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.UUID; + +import static org.apache.flink.table.gateway.rest.util.TestingRestClient.getTestingRestClient; +import static org.apache.flink.table.gateway.service.utils.SqlGatewayServiceTestUtil.fetchAllResults; +import static org.assertj.core.api.Assertions.assertThat; + +/** + * Test basic logic of handlers inherited from {@link AbstractSqlGatewayRestHandler} in materialized + * table related cases. + */ +public class SqlGatewayRestEndpointMaterializedTableITCase + extends AbstractMaterializedTableStatementITCase { + + private static TestingRestClient restClient; + + @RegisterExtension + @Order(4) + private static final SqlGatewayRestEndpointExtension SQL_GATEWAY_REST_ENDPOINT_EXTENSION = + new SqlGatewayRestEndpointExtension(SQL_GATEWAY_SERVICE_EXTENSION::getService); + + @BeforeAll + static void setup() throws Exception { + restClient = getTestingRestClient(); + } + + @Test + void testRefreshMaterializedTable() throws Exception { Review Comment: Since this is only used to verify the functionality of the rest API, I have included two scenarios for checking whether the partitioner formatter is configured in testRefreshMaterializedTableWithPeriodSchedule. -- 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]
