prajwal-jadhav01 commented on code in PR #20121: URL: https://github.com/apache/pinot/pull/20121#discussion_r4442083288
########## pinot-connectors/pinot-flink-connector/src/test/java/org/apache/pinot/connector/flink/sink/PinotSinkAuthTest.java: ########## @@ -0,0 +1,82 @@ +/** + * 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.pinot.connector.flink.sink; + +import java.util.List; +import java.util.Map; +import org.apache.pinot.spi.auth.AuthProvider; +import org.apache.pinot.spi.config.table.TableConfig; +import org.apache.pinot.spi.config.table.TableType; +import org.apache.pinot.spi.config.table.ingestion.BatchIngestionConfig; +import org.apache.pinot.spi.config.table.ingestion.IngestionConfig; +import org.apache.pinot.spi.ingestion.batch.BatchConfigProperties; +import org.apache.pinot.spi.utils.builder.TableConfigBuilder; +import org.testng.annotations.Test; + +import static org.testng.Assert.assertEquals; +import static org.testng.Assert.assertNotNull; +import static org.testng.Assert.assertNull; + + +public class PinotSinkAuthTest { Review Comment: Added both: testCreateAuthProviderWithBlankToken in PinotSinkAuthTest. PinotSinkAuthIntegrationTest: a Basic Auth-enabled cluster (BasicAuthTestUtils) running a real Flink job through PinotSink, asserting the segment is uploaded when authToken is set. I first also added a "no token, expect 401" case. The controller does return 401, but the job then fails because PinotSinkWriter.close() rethrows the failed upload during Flink's task cleanup. Flink treats that as fatal and shuts down the TaskExecutor. The failed future is never removed from _pendingUploads. That happens for any upload failure, not just auth, so I left that case out and will open a separate issue for it. -- 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] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
