Collection syntax change because of Sonar
[aaf/authz.git] / cadi / aaf / src / test / java / org / onap / aaf / cadi / cm / test / JU_Factory.java
index fb186b8..5827e8c 100644 (file)
@@ -57,11 +57,10 @@ import java.util.List;
 
 import javax.crypto.Cipher;
 
-import org.onap.aaf.cadi.cm.CertException;
-import org.onap.aaf.cadi.cm.Factory;
-import org.onap.aaf.cadi.cm.Factory.Base64InputStream;
-import org.onap.aaf.cadi.cm.Factory.StripperInputStream;
-
+import org.onap.aaf.cadi.configure.CertException;
+import org.onap.aaf.cadi.configure.Factory;
+import org.onap.aaf.cadi.configure.Factory.Base64InputStream;
+import org.onap.aaf.cadi.configure.Factory.StripperInputStream;
 import org.onap.aaf.misc.env.Env;
 import org.onap.aaf.misc.env.LogTarget;
 import org.onap.aaf.misc.env.TimeTaken;
@@ -162,8 +161,8 @@ public class JU_Factory {
                assertThat(privateKeyString.startsWith("-----BEGIN PRIVATE KEY-----"), is(true));
                assertThat(privateKeyString.endsWith("-----END PRIVATE KEY-----\n"), is(true));
 
-               PublicKey publicKey = Factory.toPublicKey(transMock, cleanupString(publicKeyString));
-               PrivateKey privateKey = Factory.toPrivateKey(transMock, cleanupString(privateKeyString));
+               PublicKey publicKey = Factory.toPublicKey(transMock, publicKeyString);
+               PrivateKey privateKey = Factory.toPrivateKey(transMock, privateKeyString);
 
                Cipher encryptor = Factory.pkCipher(publicKey, true);
                Cipher decryptor = Factory.pkCipher(privateKey, false);
@@ -239,7 +238,7 @@ public class JU_Factory {
                output = Factory.toString(transMock, certs.toArray(new Certificate[0])[0]);
                assertThat(output, is(certString));
 
-               List<String> certStrings = new ArrayList<String>();
+               List<String> certStrings = new ArrayList<>();
                certStrings.add(certString);
                certStrings.add(certString);
                certs = Factory.toX509Certificate(certStrings);
@@ -319,7 +318,7 @@ public class JU_Factory {
 
        private String cleanupString(String str) {
                String[] lines = str.split("\n", 0);
-               List<String> rawLines = new ArrayList<String>();
+               List<String> rawLines = new ArrayList<>();
                for (int i = 0; i < lines.length - 2; i++) {
                        rawLines.add(lines[i + 1]);
                }