From 689f5fecf900cf69a0d6889f96014aef48abc603 Mon Sep 17 00:00:00 2001
From: Jean-Noël Rouvignac <jean-noel.rouvignac@forgerock.com>
Date: Fri, 25 Nov 2016 14:50:10 +0000
Subject: [PATCH] Hide more DirectoryServer.getCryptoManager()

---
 opendj-server-legacy/src/test/java/org/opends/server/crypto/CryptoManagerTestCase.java |   30 +++++++++++++++---------------
 1 files changed, 15 insertions(+), 15 deletions(-)

diff --git a/opendj-server-legacy/src/test/java/org/opends/server/crypto/CryptoManagerTestCase.java b/opendj-server-legacy/src/test/java/org/opends/server/crypto/CryptoManagerTestCase.java
index 14a1116..7f0e696 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/crypto/CryptoManagerTestCase.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/crypto/CryptoManagerTestCase.java
@@ -16,6 +16,17 @@
  */
 package org.opends.server.crypto;
 
+import static org.assertj.core.api.Assertions.*;
+import static org.forgerock.opendj.ldap.LDAPConnectionFactory.*;
+import static org.forgerock.opendj.ldap.ModificationType.*;
+import static org.forgerock.opendj.ldap.SearchScope.*;
+import static org.opends.server.TestCaseUtils.*;
+import static org.opends.server.config.ConfigConstants.*;
+import static org.opends.server.protocols.internal.InternalClientConnection.*;
+import static org.opends.server.protocols.internal.Requests.*;
+import static org.opends.server.types.Attributes.*;
+import static org.testng.Assert.*;
+
 import java.io.File;
 import java.io.FileInputStream;
 import java.io.FileOutputStream;
@@ -57,17 +68,6 @@
 import org.testng.annotations.DataProvider;
 import org.testng.annotations.Test;
 
-import static org.assertj.core.api.Assertions.*;
-import static org.forgerock.opendj.ldap.LDAPConnectionFactory.*;
-import static org.forgerock.opendj.ldap.ModificationType.*;
-import static org.forgerock.opendj.ldap.SearchScope.*;
-import static org.opends.server.TestCaseUtils.*;
-import static org.opends.server.config.ConfigConstants.*;
-import static org.opends.server.protocols.internal.InternalClientConnection.*;
-import static org.opends.server.protocols.internal.Requests.*;
-import static org.opends.server.types.Attributes.*;
-import static org.testng.Assert.*;
-
 /**
  This class tests the CryptoManager.
  */
@@ -242,7 +242,7 @@
 @Test(dataProvider="cipherParametersData")
   public void testEncryptDecryptSuccess(CipherParameters cp)
           throws Exception {
-    final CryptoManager cm = DirectoryServer.getCryptoManager();
+    final CryptoManager cm = getServerContext().getCryptoManager();
     final String secretMessage = "1234";
 
     final byte[] cipherText = (null == cp.getTransformation())
@@ -305,7 +305,7 @@
   public void testKeyEntryReuse()
           throws Exception {
 
-    final CryptoManager cm = DirectoryServer.getCryptoManager();
+    final CryptoManager cm = TestCaseUtils.getServerContext().getCryptoManager();
     final String secretMessage = "zyxwvutsrqponmlkjihgfedcba";
 
     final byte[] cipherText = cm.encrypt(secretMessage.getBytes());
@@ -335,7 +335,7 @@
   @Test
   public void testKeyPersistence()
         throws Exception {
-    final CryptoManager cm = DirectoryServer.getCryptoManager();
+    final CryptoManager cm = getServerContext().getCryptoManager();
     final String secretMessage = "zyxwvutsrqponmlkjihgfedcba";
 
     final byte[] cipherText = cm.encrypt("Blowfish/CFB/NoPadding", 128,
@@ -363,7 +363,7 @@
    */
   @Test
   public void testCompromisedKey() throws Exception {
-    final CryptoManager cm = DirectoryServer.getCryptoManager();
+    final CryptoManager cm = getServerContext().getCryptoManager();
     final String secretMessage = "zyxwvutsrqponmlkjihgfedcba";
     final String cipherTransformationName = "AES/CBC/PKCS5Padding";
     final int cipherKeyLength = 128;

--
Gitblit v1.10.0