NIFI-13365 - Fix unit tests running in kubernetes pod

This commit is contained in:
Laszlo Denes Terjeki 2024-06-05 16:41:30 +00:00
parent 0a5be35357
commit 61ce13c4f3
2 changed files with 3 additions and 1 deletions

View File

@ -37,6 +37,7 @@ public class ExternalHazelcastCacheManagerTest extends AbstractHazelcastCacheMan
final Config config = new Config(); final Config config = new Config();
config.getNetworkConfig().setPort(0); config.getNetworkConfig().setPort(0);
config.setClusterName("nifi"); config.setClusterName("nifi");
config.getNetworkConfig().getJoin().getAutoDetectionConfig().setEnabled(false);
hazelcastInstance = Hazelcast.newHazelcastInstance(config); hazelcastInstance = Hazelcast.newHazelcastInstance(config);
super.setUp(); super.setUp();

View File

@ -28,6 +28,7 @@ import org.apache.nifi.components.ValidationResult;
import org.apache.nifi.components.state.Scope; import org.apache.nifi.components.state.Scope;
import org.apache.nifi.components.state.StateMap; import org.apache.nifi.components.state.StateMap;
import org.apache.nifi.components.state.StateProviderInitializationContext; import org.apache.nifi.components.state.StateProviderInitializationContext;
import org.apache.nifi.kubernetes.client.ServiceAccountNamespaceProvider;
import org.apache.nifi.logging.ComponentLog; import org.apache.nifi.logging.ComponentLog;
import org.apache.nifi.parameter.ParameterLookup; import org.apache.nifi.parameter.ParameterLookup;
import org.apache.nifi.util.MockProcessContext; import org.apache.nifi.util.MockProcessContext;
@ -63,7 +64,7 @@ class KubernetesConfigMapStateProviderTest {
private static final String SECOND_VERSION = "2"; private static final String SECOND_VERSION = "2";
private static final String DEFAULT_NAMESPACE = "default"; private static final String DEFAULT_NAMESPACE = new ServiceAccountNamespaceProvider().getNamespace();
private static final String COMPONENT_ID = "COMPONENT-ID"; private static final String COMPONENT_ID = "COMPONENT-ID";