2 * This file was automatically generated by EvoSuite
3 * Mon Nov 14 09:07:10 GMT 2016
6 package org.openecomp.mso.utils;
9 import static org.junit.Assert.*;
10 import static org.evosuite.runtime.EvoAssertions.*;
12 import javax.crypto.BadPaddingException;
13 import javax.crypto.IllegalBlockSizeException;
14 import java.security.InvalidKeyException;
16 import org.evosuite.runtime.EvoRunner;
17 import org.evosuite.runtime.EvoRunnerParameters;
18 import org.junit.runner.RunWith;
20 @RunWith(EvoRunner.class) @EvoRunnerParameters(mockJVMNonDeterminism = true, useVFS = true, useVNET = true, resetStaticState = true, useJEE = true)
21 public class CryptoUtilsESTest extends CryptoUtilsESTestscaffolding {
24 public void test00() throws Throwable {
25 CryptoUtils.decrypt("E08682BE5F2B18A6E8437A15B110D418E08682BE5F2B18A6E8437A15B110D4180143DB63EE66B0CDFF9F69917680151E", "00000000000000000000000000000000");
29 public void test01() throws Throwable {
30 byte[] byteArray0 = new byte[0];
31 CryptoUtils.byteArrayToHexString(byteArray0);
35 public void test02() throws Throwable {
36 // Undeclared exception!
38 CryptoUtils.encrypt("AES", "w^p&|^Cvs@K.@@");
39 fail("Expecting exception: NumberFormatException");
41 } catch(NumberFormatException e) {
43 // For input string: \"w^\"
45 verifyException("java.lang.NumberFormatException", e);
50 public void test03() throws Throwable {
51 // Undeclared exception!
53 CryptoUtils.encrypt((String) null, "B2000000000000000000000000000000");
54 fail("Expecting exception: NullPointerException");
56 } catch(NullPointerException e) {
58 // no message in exception (getMessage() returned null)
60 verifyException("org.openecomp.mso.utils.CryptoUtils", e);
65 public void test04() throws Throwable {
67 CryptoUtils.decrypt("B20000000000000000000000000000000000000000000000", "B20000000000000000000000000000000000000000000000");
68 fail("Expecting exception: IllegalBlockSizeException");
70 } catch(IllegalBlockSizeException | InvalidKeyException e) {
75 public void test05() throws Throwable {
77 CryptoUtils.decrypt("0000C200000000000000000000000000", "0000C200000000000000000000000000");
78 fail("Expecting exception: BadPaddingException");
80 } catch(BadPaddingException e) {
85 public void test06() throws Throwable {
86 // Undeclared exception!
88 CryptoUtils.decrypt("s.", "s.");
89 fail("Expecting exception: NumberFormatException");
91 } catch(NumberFormatException e) {
93 // For input string: \"s.\"
95 verifyException("java.lang.NumberFormatException", e);
100 public void test07() throws Throwable {
101 // Undeclared exception!
103 CryptoUtils.decrypt("", "");
104 fail("Expecting exception: IllegalArgumentException");
106 } catch(IllegalArgumentException e) {
110 verifyException("javax.crypto.spec.SecretKeySpec", e);
114 @Test(timeout = 4000)
115 public void test08() throws Throwable {
116 // Undeclared exception!
118 CryptoUtils.byteArrayToHexString((byte[]) null);
119 fail("Expecting exception: NullPointerException");
121 } catch(NullPointerException e) {
123 // no message in exception (getMessage() returned null)
125 verifyException("org.openecomp.mso.utils.CryptoUtils", e);
129 @Test(timeout = 4000)
130 public void test09() throws Throwable {
131 byte[] byteArray0 = new byte[16];
132 byteArray0[0] = (byte) (-78);
133 String string0 = CryptoUtils.byteArrayToHexString(byteArray0);
134 assertEquals("B2000000000000000000000000000000", string0);
137 @Test(timeout = 4000)
138 public void test10() throws Throwable {
139 String string0 = CryptoUtils.encrypt("00000000000000000000000000000000", "00000000000000000000000000000000");
140 assertEquals("E08682BE5F2B18A6E8437A15B110D418E08682BE5F2B18A6E8437A15B110D4180143DB63EE66B0CDFF9F69917680151E", string0);
143 @Test(timeout = 4000)
144 public void test11() throws Throwable {
145 // Undeclared exception!
147 CryptoUtils.encrypt("", "");
148 fail("Expecting exception: IllegalArgumentException");
150 } catch(IllegalArgumentException e) {
154 verifyException("javax.crypto.spec.SecretKeySpec", e);
158 @Test(timeout = 4000)
159 public void test12() throws Throwable {
160 CryptoUtils cryptoUtils0 = new CryptoUtils();
163 @Test(timeout = 4000)
164 public void test13() throws Throwable {
165 // Undeclared exception!
167 CryptoUtils.decrypt((String) null, "00000000000000000000000000000000");
168 fail("Expecting exception: NullPointerException");
170 } catch(NullPointerException e) {
172 // no message in exception (getMessage() returned null)
174 verifyException("org.openecomp.mso.utils.CryptoUtils", e);