/*
 * 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.connectors.test.common.environment.ClusterControllable;
import org.apache.flink.connectors.test.common.environment.MiniClusterTestEnvironment;
import org.apache.flink.connectors.test.common.environment.TestEnvironment;
import org.apache.flink.connectors.test.common.external.ExternalContext;
import org.apache.flink.connectors.test.common.junit.annotations.ExternalContextFactory;
import org.apache.flink.connectors.test.common.junit.annotations.ExternalSystem;
import org.apache.flink.connectors.test.common.junit.annotations.TestEnv;
import org.apache.flink.connectors.test.common.testsuites.SourceTestSuiteBase;

import org.junit.jupiter.api.Disabled;

/** 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
    @ExternalSystem PulsarTestEnvironment pulsar = new PulsarTestEnvironment(PulsarRuntime.MOCK);

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

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

    @Disabled
    @Override
    public void testTaskManagerFailure(
            TestEnvironment testEnv,
            ExternalContext<String> externalContext,
            ClusterControllable controller)
            throws Exception {
        super.testTaskManagerFailure(testEnv, externalContext, controller);
    }
}

@@ -1313,262 +1313,33 @@
 ent.
-ClusterControllable;%0Aimport org.apache.flink.connectors.test.common.environment.MiniClusterTestEnvironment;%0Aimport org.apache.flink.connectors.test.common.environment.TestEnvironment;%0Aimport org.apache.flink.connectors.test.common.external.ExternalContex
+MiniClusterTestEnvironmen
 t;%0Ai
@@ -1665,48 +1665,8 @@
 e;%0A%0A
-import org.junit.jupiter.api.Disabled;%0A%0A
 /** 
@@ -2491,32 +2491,32 @@
 multipleTopic =%0A
+
             new 
@@ -2590,323 +2590,7 @@
 ew);
-%0A%0A    @Disabled%0A    @Override%0A    public void testTaskManagerFailure(%0A            TestEnvironment testEnv,%0A            ExternalContext%3CString%3E externalContext,%0A            ClusterControllable controller)%0A            throws Exception %7B%0A        super.testTaskManagerFailure(testEnv, externalContext, controller);%0A    %7D
 %0A%7D%0A

Enable PulsarSourceITCase.testTaskManagerFailure after test framework was fixed.