zentol commented on code in PR #20574: URL: https://github.com/apache/flink/pull/20574#discussion_r945542507
########## flink-table/flink-sql-gateway/src/test/java/org/apache/flink/table/gateway/rest/compatibility/SqlGatewayRestAPIStabilityTest.java: ########## @@ -0,0 +1,209 @@ +/* + * 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.compatibility; + +import org.apache.flink.api.java.tuple.Tuple2; +import org.apache.flink.runtime.rest.compatibility.AbstractRestAPIStabilityTest; +import org.apache.flink.runtime.rest.compatibility.Compatibility; +import org.apache.flink.runtime.rest.compatibility.CompatibilityCheckResult; +import org.apache.flink.runtime.rest.compatibility.CompatibilityRoutine; +import org.apache.flink.runtime.rest.compatibility.CompatibilityRoutines; +import org.apache.flink.runtime.rest.util.DocumentingRestEndpoint; +import org.apache.flink.table.gateway.rest.util.DocumentingSqlGatewayRestEndpoint; +import org.apache.flink.table.gateway.rest.util.SqlGatewayRestAPIVersion; +import org.apache.flink.util.ConfigurationException; +import org.apache.flink.util.jackson.JacksonMapperFactory; + +import org.apache.flink.shaded.jackson2.com.fasterxml.jackson.core.util.DefaultIndenter; +import org.apache.flink.shaded.jackson2.com.fasterxml.jackson.core.util.DefaultPrettyPrinter; +import org.apache.flink.shaded.jackson2.com.fasterxml.jackson.databind.JsonNode; +import org.apache.flink.shaded.jackson2.com.fasterxml.jackson.databind.ObjectMapper; +import org.apache.flink.shaded.jackson2.com.fasterxml.jackson.databind.node.ObjectNode; + +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.extension.ExtensionContext; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.Arguments; +import org.junit.jupiter.params.provider.ArgumentsProvider; +import org.junit.jupiter.params.provider.ArgumentsSource; + +import java.io.File; +import java.io.IOException; +import java.net.URL; +import java.util.Arrays; +import java.util.List; +import java.util.stream.Collectors; +import java.util.stream.Stream; + +/** Stability test and snapshot generator for the Sql Gateway REST API. */ +final class SqlGatewayRestAPIStabilityTest extends AbstractRestAPIStabilityTest { Review Comment: This class still contains a _lot_ of duplicate code taken from the RuntimeRestAPIStabilityTest; surely we can reduce that further. What exactly stops you from doing something like this: @ParameterizedTest @ArgumentsSource(StableSqlGatewayRestApiVersionProvider.class) void testSqlGatewayRestAPIStability(SqlGatewayRestAPIVersion apiVersion) { RestApiStabilityTest.testStability(apiVersion, REGENERATE_SNAPSHOT_PROPERTY, SNAPSHOT_RESOURCE_PATTERN,...); } ########## flink-table/flink-sql-gateway/src/test/java/org/apache/flink/table/gateway/rest/compatibility/SqlGatewayRestAPIStabilityTest.java: ########## @@ -0,0 +1,209 @@ +/* + * 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.compatibility; + +import org.apache.flink.api.java.tuple.Tuple2; +import org.apache.flink.runtime.rest.compatibility.AbstractRestAPIStabilityTest; +import org.apache.flink.runtime.rest.compatibility.Compatibility; +import org.apache.flink.runtime.rest.compatibility.CompatibilityCheckResult; +import org.apache.flink.runtime.rest.compatibility.CompatibilityRoutine; +import org.apache.flink.runtime.rest.compatibility.CompatibilityRoutines; +import org.apache.flink.runtime.rest.util.DocumentingRestEndpoint; +import org.apache.flink.table.gateway.rest.util.DocumentingSqlGatewayRestEndpoint; +import org.apache.flink.table.gateway.rest.util.SqlGatewayRestAPIVersion; +import org.apache.flink.util.ConfigurationException; +import org.apache.flink.util.jackson.JacksonMapperFactory; + +import org.apache.flink.shaded.jackson2.com.fasterxml.jackson.core.util.DefaultIndenter; +import org.apache.flink.shaded.jackson2.com.fasterxml.jackson.core.util.DefaultPrettyPrinter; +import org.apache.flink.shaded.jackson2.com.fasterxml.jackson.databind.JsonNode; +import org.apache.flink.shaded.jackson2.com.fasterxml.jackson.databind.ObjectMapper; +import org.apache.flink.shaded.jackson2.com.fasterxml.jackson.databind.node.ObjectNode; + +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.extension.ExtensionContext; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.Arguments; +import org.junit.jupiter.params.provider.ArgumentsProvider; +import org.junit.jupiter.params.provider.ArgumentsSource; + +import java.io.File; +import java.io.IOException; +import java.net.URL; +import java.util.Arrays; +import java.util.List; +import java.util.stream.Collectors; +import java.util.stream.Stream; + +/** Stability test and snapshot generator for the Sql Gateway REST API. */ +final class SqlGatewayRestAPIStabilityTest extends AbstractRestAPIStabilityTest { Review Comment: This class still contains a _lot_ of duplicate code taken from the RuntimeRestAPIStabilityTest; surely we can reduce that further. What exactly stops you from doing something like this: ``` @ParameterizedTest @ArgumentsSource(StableSqlGatewayRestApiVersionProvider.class) void testSqlGatewayRestAPIStability(SqlGatewayRestAPIVersion apiVersion) { RestApiStabilityTest.testStability(apiVersion, REGENERATE_SNAPSHOT_PROPERTY, SNAPSHOT_RESOURCE_PATTERN,...); } ``` -- 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]
