NIFI-11990 Disabled Kubernetes Auto Config in Test Class

Signed-off-by: Pierre Villard <pierre.villard.fr@gmail.com>

This closes #7643.
This commit is contained in:
exceptionfactory 2023-08-24 09:24:54 -05:00 committed by Pierre Villard
parent 3b21794255
commit 807df22af9
No known key found for this signature in database
GPG Key ID: F92A93B30C07C6D5
1 changed files with 14 additions and 0 deletions

View File

@ -17,6 +17,8 @@
package org.apache.nifi.kubernetes.client;
import io.fabric8.kubernetes.client.KubernetesClient;
import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.Timeout;
@ -24,8 +26,20 @@ import org.junit.jupiter.api.Timeout;
import static org.junit.jupiter.api.Assertions.assertNotNull;
class StandardKubernetesClientProviderTest {
private static final String DISABLE_AUTO_CONFIG_PROPERTY = "kubernetes.disable.autoConfig";
StandardKubernetesClientProvider provider;
@BeforeAll
static void setDisableAutoConfig() {
System.setProperty(DISABLE_AUTO_CONFIG_PROPERTY, Boolean.TRUE.toString());
}
@AfterAll
static void clearDisableAutoConfig() {
System.clearProperty(DISABLE_AUTO_CONFIG_PROPERTY);
}
@BeforeEach
void setProvider() {
provider = new StandardKubernetesClientProvider();