public class SecureTestEnvironment extends Object
SecureTestEnvironment
to handle MiniKDC lifecycle.
This class can be used to start/stop MiniKDC and create secure configurations for MiniDFSCluster
and MiniYarn.
If you use this class in your project, please make sure to add a dependency to hadoop-minikdc, e.g. in your pom.xml:
... <dependencies> <dependency> <groupId>org.apache.hadoop</groupId> <artifactId>hadoop-minikdc</artifactId> <version>${minikdc.version}</version> <scope>compile</scope> </dependency> ... </dependencies> ... <build> <plugins> <!-- https://issues.apache.org/jira/browse/DIRSHARED-134 Required to pull the Mini-KDC transitive dependency --> <plugin> <groupId>org.apache.felix</groupId> <artifactId>maven-bundle-plugin</artifactId> <version>3.0.1</version> <inherited>true</inherited> <extensions>true</extensions> </plugin> ...
Modifier and Type | Field and Description |
---|---|
protected static org.slf4j.Logger |
LOG |
Constructor and Description |
---|
SecureTestEnvironment() |
Modifier and Type | Method and Description |
---|---|
static void |
cleanup() |
static Map<String,org.apache.flink.test.util.TestingSecurityContext.ClientSecurityConfiguration> |
getClientSecurityConfigurationMap() |
static String |
getHadoopServicePrincipal() |
static String |
getTestKeytab() |
static Configuration |
populateFlinkSecureConfigurations(Configuration flinkConf) |
static void |
prepare(org.junit.rules.TemporaryFolder tempFolder) |
public static void prepare(org.junit.rules.TemporaryFolder tempFolder)
public static void cleanup()
public static Configuration populateFlinkSecureConfigurations(@Nullable Configuration flinkConf)
public static Map<String,org.apache.flink.test.util.TestingSecurityContext.ClientSecurityConfiguration> getClientSecurityConfigurationMap()
public static String getTestKeytab()
public static String getHadoopServicePrincipal()
Copyright © 2014–2019 The Apache Software Foundation. All rights reserved.