summaryrefslogtreecommitdiffstats
path: root/src/test/java
diff options
context:
space:
mode:
authorbiniek <lukasz.biniek@nokia.com>2017-12-19 11:57:06 +0100
committerbiniek <lukasz.biniek@nokia.com>2017-12-19 14:58:08 +0100
commita029b8b76a2a2d028f8a97f6a6884d90ebfd3fbc (patch)
tree7c9dcd129ca1e1e40d2bf47b8158d985cc41eea1 /src/test/java
parenta4096a47f893c1ed0a231303093c3fbba6865641 (diff)
Cleanup of utils classes.
Removed javadoc without any information; enforced util class won't be initialized; extracted constants. Change-Id: Ie30156472d929dfc95819a1d5affaaf867eed611 Issue-ID: CLAMP-96 Signed-off-by: biniek <lukasz.biniek@nokia.com>
Diffstat (limited to 'src/test/java')
-rw-r--r--src/test/java/org/onap/clamp/clds/util/CryptoUtilsTest.java39
1 files changed, 9 insertions, 30 deletions
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 6fe44755..c6aafcd8 100644
--- a/src/test/java/org/onap/clamp/clds/util/CryptoUtilsTest.java
+++ b/src/test/java/org/onap/clamp/clds/util/CryptoUtilsTest.java
@@ -27,47 +27,26 @@ import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotEquals;
import static org.junit.Assert.assertNotNull;
-import java.io.UnsupportedEncodingException;
-import java.security.GeneralSecurityException;
-
-import org.apache.commons.codec.DecoderException;
import org.apache.commons.codec.binary.Hex;
import org.apache.commons.lang3.ArrayUtils;
import org.junit.Test;
-/**
- * Test Crypto Utils with Spring.
- */
+
public class CryptoUtilsTest {
- private CryptoUtils cryptoUtils = new CryptoUtils();
- final String data = "This is a test string";
- /**
- * This method tests encryption.
- *
- * @throws GeneralSecurityException
- * @throws DecoderException
- * @throws UnsupportedEncodingException
- */
+ private final String data = "This is a test string";
+
@Test
- public final void testEncryption() throws GeneralSecurityException, DecoderException, UnsupportedEncodingException {
- String encodedString = cryptoUtils.encrypt(data);
+ public final void testEncryption() throws Exception {
+ String encodedString = CryptoUtils.encrypt(data);
assertNotNull(encodedString);
- assertEquals(data, cryptoUtils.decrypt(encodedString));
+ assertEquals(data, CryptoUtils.decrypt(encodedString));
}
- /**
- * This method tests encryption.
- *
- * @throws GeneralSecurityException
- * @throws DecoderException
- * @throws UnsupportedEncodingException
- */
@Test
- public final void testEncryptedStringIsDifferent()
- throws GeneralSecurityException, DecoderException, UnsupportedEncodingException {
- String encodedString1 = cryptoUtils.encrypt(data);
- String encodedString2 = cryptoUtils.encrypt(data);
+ public final void testEncryptedStringIsDifferent() throws Exception {
+ String encodedString1 = CryptoUtils.encrypt(data);
+ String encodedString2 = CryptoUtils.encrypt(data);
byte[] encryptedMessage1 = Hex.decodeHex(encodedString1.toCharArray());
byte[] encryptedMessage2 = Hex.decodeHex(encodedString2.toCharArray());
assertNotNull(encryptedMessage1);