HDFS-13651. TestReencryptionHandler fails on Windows. Contributed by Anbang Hu.
(cherry picked from commit e308ac88d3
)
This commit is contained in:
parent
e59e9feefa
commit
8a9c2d7b97
|
@ -36,6 +36,7 @@ import org.mockito.internal.util.reflection.Whitebox;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
import org.slf4j.event.Level;
|
import org.slf4j.event.Level;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
@ -67,9 +68,11 @@ public class TestReencryptionHandler {
|
||||||
private ReencryptionHandler mockReencryptionhandler(final Configuration conf)
|
private ReencryptionHandler mockReencryptionhandler(final Configuration conf)
|
||||||
throws IOException {
|
throws IOException {
|
||||||
// mock stuff to create a mocked ReencryptionHandler
|
// mock stuff to create a mocked ReencryptionHandler
|
||||||
|
FileSystemTestHelper helper = new FileSystemTestHelper();
|
||||||
|
Path targetFile = new Path(new File(helper.getTestRootDir())
|
||||||
|
.getAbsolutePath(), "test.jks");
|
||||||
conf.set(CommonConfigurationKeysPublic.HADOOP_SECURITY_KEY_PROVIDER_PATH,
|
conf.set(CommonConfigurationKeysPublic.HADOOP_SECURITY_KEY_PROVIDER_PATH,
|
||||||
JavaKeyStoreProvider.SCHEME_NAME + "://file" + new Path(
|
JavaKeyStoreProvider.SCHEME_NAME + "://file" + targetFile.toUri());
|
||||||
new FileSystemTestHelper().getTestRootDir(), "test.jks").toUri());
|
|
||||||
final EncryptionZoneManager ezm = Mockito.mock(EncryptionZoneManager.class);
|
final EncryptionZoneManager ezm = Mockito.mock(EncryptionZoneManager.class);
|
||||||
final KeyProvider kp = KMSUtil.createKeyProvider(conf,
|
final KeyProvider kp = KMSUtil.createKeyProvider(conf,
|
||||||
CommonConfigurationKeysPublic.HADOOP_SECURITY_KEY_PROVIDER_PATH);
|
CommonConfigurationKeysPublic.HADOOP_SECURITY_KEY_PROVIDER_PATH);
|
||||||
|
|
Loading…
Reference in New Issue