/*
 * 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.connector.pulsar.source;

import org.apache.flink.connector.pulsar.testutils.PulsarTestContextFactory;
import org.apache.flink.connector.pulsar.testutils.PulsarTestEnvironment;
import org.apache.flink.connector.pulsar.testutils.cases.MultipleTopicConsumingContext;
import org.apache.flink.connector.pulsar.testutils.cases.SingleTopicConsumingContext;
import org.apache.flink.connector.pulsar.testutils.runtime.PulsarRuntime;
import org.apache.flink.connector.testframe.environment.MiniClusterTestEnvironment;
import org.apache.flink.connector.testframe.junit.annotations.TestContext;
import org.apache.flink.connector.testframe.junit.annotations.TestEnv;
import org.apache.flink.connector.testframe.junit.annotations.TestExternalSystem;
import org.apache.flink.connector.testframe.junit.annotations.TestSemantics;
import org.apache.flink.connector.testframe.testsuites.SourceTestSuiteBase;
import org.apache.flink.streaming.api.CheckpointingMode;

/** Unite test class for {@link PulsarSource}. */
@SuppressWarnings("unused")
class PulsarSourceITCase extends SourceTestSuiteBase<String> {

    // Defines test environment on Flink MiniCluster
    @TestEnv MiniClusterTestEnvironment flink = new MiniClusterTestEnvironment();

    // Defines pulsar running environment
    @TestExternalSystem
    PulsarTestEnvironment pulsar = new PulsarTestEnvironment(PulsarRuntime.embedded());

    @TestSemantics
    CheckpointingMode[] semantics = new CheckpointingMode[] {CheckpointingMode.EXACTLY_ONCE};

    // Defines an external context Factories,
    // so test cases will be invoked using this external contexts.
    @TestContext
    PulsarTestContextFactory<String, SingleTopicConsumingContext> singleTopic =
            new PulsarTestContextFactory<>(pulsar, SingleTopicConsumingContext::new);

    @TestContext
    PulsarTestContextFactory<String, MultipleTopicConsumingContext> multipleTopic =
            new PulsarTestContextFactory<>(pulsar, MultipleTopicConsumingContext::new);
}

@@ -1326,32 +1326,198 @@
 estEnvironment;%0A
+import org.apache.flink.connector.testframe.environment.TestEnvironment;%0Aimport org.apache.flink.connector.testframe.external.source.DataStreamSourceExternalContext;%0A
 import org.apach
@@ -1567,32 +1567,32 @@
 ns.TestContext;%0A
-
 import org.apach
@@ -1939,16 +1939,56 @@
 gMode;%0A%0A
+import org.junit.jupiter.api.Disabled;%0A%0A
 /** Unit
@@ -2057,16 +2057,16 @@
 nused%22)%0A
-
 class Pu
@@ -2121,16 +2121,732 @@
 ing%3E %7B%0A%0A
+    @Disabled // TODO: remove override after FLINK-26177 is fixed%0A    @Override%0A    public void testScaleUp(%0A            TestEnvironment testEnv,%0A            DataStreamSourceExternalContext%3CString%3E externalContext,%0A            CheckpointingMode semantic)%0A            throws Exception %7B%0A        super.testScaleUp(testEnv, externalContext, semantic);%0A    %7D%0A%0A    @Disabled // TODO: remove override after FLINK-26177 is fixed%0A    @Override%0A    public void testScaleDown(%0A            TestEnvironment testEnv,%0A            DataStreamSourceExternalContext%3CString%3E externalContext,%0A            CheckpointingMode semantic)%0A            throws Exception %7B%0A        super.testScaleDown(testEnv, externalContext, semantic);%0A    %7D%0A%0A
     // D

Disable PulsarSourceITCase rescaling tests temporarily