X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=src%2Ftest%2Fjava%2Forg%2Fonap%2Fclamp%2Fclds%2Futil%2FCryptoUtilsTest.java;h=f6054d538fb6758484b3c3427285f1db9d5f49bf;hb=refs%2Fchanges%2F68%2F101068%2F16;hp=1e6742c989b471a7729d637c7370b57788129920;hpb=6d8bb93e25f82d8eea0c5211bd630804866f3097;p=clamp.git diff --git a/src/test/java/org/onap/clamp/clds/util/CryptoUtilsTest.java b/src/test/java/org/onap/clamp/clds/util/CryptoUtilsTest.java index 1e6742c9..f6054d53 100644 --- a/src/test/java/org/onap/clamp/clds/util/CryptoUtilsTest.java +++ b/src/test/java/org/onap/clamp/clds/util/CryptoUtilsTest.java @@ -28,7 +28,7 @@ package org.onap.clamp.clds.util; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotEquals; import static org.junit.Assert.assertNotNull; -import static org.mockito.Matchers.eq; +import static org.mockito.ArgumentMatchers.eq; import java.security.InvalidKeyException; @@ -45,13 +45,13 @@ import org.powermock.core.classloader.annotations.PrepareForTest; import org.powermock.modules.junit4.PowerMockRunner; @RunWith(PowerMockRunner.class) -@PowerMockIgnore({"javax.crypto.*"}) +@PowerMockIgnore({ "javax.crypto.*", "com.sun.org.apache.xerces.*", "javax.xml.*", "org.xml.*", "javax.management.*" }) public class CryptoUtilsTest { private final String data = "This is a test string"; @Test - @PrepareForTest({CryptoUtils.class}) + @PrepareForTest({ CryptoUtils.class }) public final void testEncryption() throws Exception { String encodedString = CryptoUtils.encrypt(data); assertNotNull(encodedString); @@ -59,7 +59,7 @@ public class CryptoUtilsTest { } @Test - @PrepareForTest({CryptoUtils.class}) + @PrepareForTest({ CryptoUtils.class }) public final void testEncryptedStringIsDifferent() throws Exception { String encodedString1 = CryptoUtils.encrypt(data); String encodedString2 = CryptoUtils.encrypt(data); @@ -74,7 +74,7 @@ public class CryptoUtilsTest { } @Test - @PrepareForTest({CryptoUtils.class}) + @PrepareForTest({ CryptoUtils.class }) public final void testEncryptionBaseOnRandomKey() throws Exception { SecretKey secretKey = KeyGenerator.getInstance("AES").generateKey(); final String encryptionKey = String.valueOf(Hex.encodeHex(secretKey.getEncoded())); @@ -86,7 +86,7 @@ public class CryptoUtilsTest { } @Test(expected = InvalidKeyException.class) - @PrepareForTest({CryptoUtils.class}) + @PrepareForTest({ CryptoUtils.class }) public final void testEncryptionBadKey() throws Exception { final String badEncryptionKey = "93210sd"; setAesEncryptionKeyEnv(badEncryptionKey);