package testdata;

import de.accso.flexinale.common.infrastructure.eventbus.KafkaAvailabilityChecker;
import de.accso.flexinale.common.shared_kernel.DoNotCheckInArchitectureTests;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.util.concurrent.ExecutionException;
import java.util.concurrent.TimeoutException;

import static de.accso.flexinale.common.infrastructure.eventbus.KafkaTopicHelper.deleteKafkaTopicsWithPrefixAndSuffix;

@DoNotCheckInArchitectureTests
@SuppressWarnings("NewClassNamingConvention")
@Disabled("needs Kafka and hence only to be called manually and explicitely")
class KafkaTopicCleaner {
    private static final Logger LOGGER = LoggerFactory.getLogger(KafkaTopicCleaner.class);

    @Test
    void deleteAllFlexinaleKafkaTopics() throws ExecutionException, TimeoutException {
        new KafkaAvailabilityChecker().isKafkaAvailable();
        deleteKafkaTopicsWithPrefixAndSuffix("de.accso.flexinale", "");
    }
}
