[MSO-8] Update the maven dependency
[so.git] / common / src / test / java / org / openecomp / mso / utils / CryptoUtilsESTest.java
1 /*
2  * This file was automatically generated by EvoSuite
3  * Mon Nov 14 09:07:10 GMT 2016
4  */
5
6 package org.openecomp.mso.utils;
7
8 import org.junit.Test;
9 import static org.junit.Assert.*;
10 import static org.evosuite.runtime.EvoAssertions.*;
11
12 import javax.crypto.BadPaddingException;
13 import javax.crypto.IllegalBlockSizeException;
14 import java.security.InvalidKeyException;
15
16 import org.evosuite.runtime.EvoRunner;
17 import org.evosuite.runtime.EvoRunnerParameters;
18 import org.junit.runner.RunWith;
19
20 @RunWith(EvoRunner.class) @EvoRunnerParameters(mockJVMNonDeterminism = true, useVFS = true, useVNET = true, resetStaticState = true, useJEE = true) 
21 public class CryptoUtilsESTest extends CryptoUtilsESTestscaffolding {
22
23   @Test(timeout = 4000)
24   public void test00()  throws Throwable  {
25       CryptoUtils.decrypt("E08682BE5F2B18A6E8437A15B110D418E08682BE5F2B18A6E8437A15B110D4180143DB63EE66B0CDFF9F69917680151E", "00000000000000000000000000000000");
26   }
27
28   @Test(timeout = 4000)
29   public void test01()  throws Throwable  {
30       byte[] byteArray0 = new byte[0];
31       CryptoUtils.byteArrayToHexString(byteArray0);
32   }
33
34   @Test(timeout = 4000)
35   public void test02()  throws Throwable  {
36       // Undeclared exception!
37       try { 
38         CryptoUtils.encrypt("AES", "w^p&|^Cvs@K.@@");
39         fail("Expecting exception: NumberFormatException");
40       
41       } catch(NumberFormatException e) {
42          //
43          // For input string: \"w^\"
44          //
45          verifyException("java.lang.NumberFormatException", e);
46       }
47   }
48
49   @Test(timeout = 4000)
50   public void test03()  throws Throwable  {
51       // Undeclared exception!
52       try { 
53         CryptoUtils.encrypt((String) null, "B2000000000000000000000000000000");
54         fail("Expecting exception: NullPointerException");
55       
56       } catch(NullPointerException e) {
57          //
58          // no message in exception (getMessage() returned null)
59          //
60          verifyException("org.openecomp.mso.utils.CryptoUtils", e);
61       }
62   }
63
64   @Test(timeout = 4000)
65   public void test04()  throws Throwable  {
66       try { 
67         CryptoUtils.decrypt("B20000000000000000000000000000000000000000000000", "B20000000000000000000000000000000000000000000000");
68         fail("Expecting exception: IllegalBlockSizeException");
69       
70       } catch(IllegalBlockSizeException | InvalidKeyException e) {
71       }
72   }
73
74   @Test(timeout = 4000)
75   public void test05()  throws Throwable  {
76       try { 
77         CryptoUtils.decrypt("0000C200000000000000000000000000", "0000C200000000000000000000000000");
78         fail("Expecting exception: BadPaddingException");
79       
80       } catch(BadPaddingException e) {
81       }
82   }
83
84   @Test(timeout = 4000)
85   public void test06()  throws Throwable  {
86       // Undeclared exception!
87       try { 
88         CryptoUtils.decrypt("s.", "s.");
89         fail("Expecting exception: NumberFormatException");
90       
91       } catch(NumberFormatException e) {
92          //
93          // For input string: \"s.\"
94          //
95          verifyException("java.lang.NumberFormatException", e);
96       }
97   }
98
99   @Test(timeout = 4000)
100   public void test07()  throws Throwable  {
101       // Undeclared exception!
102       try { 
103         CryptoUtils.decrypt("", "");
104         fail("Expecting exception: IllegalArgumentException");
105       
106       } catch(IllegalArgumentException e) {
107          //
108          // Empty key
109          //
110          verifyException("javax.crypto.spec.SecretKeySpec", e);
111       }
112   }
113
114   @Test(timeout = 4000)
115   public void test08()  throws Throwable  {
116       // Undeclared exception!
117       try { 
118         CryptoUtils.byteArrayToHexString((byte[]) null);
119         fail("Expecting exception: NullPointerException");
120       
121       } catch(NullPointerException e) {
122          //
123          // no message in exception (getMessage() returned null)
124          //
125          verifyException("org.openecomp.mso.utils.CryptoUtils", e);
126       }
127   }
128
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);
135   }
136
137   @Test(timeout = 4000)
138   public void test10()  throws Throwable  {
139       String string0 = CryptoUtils.encrypt("00000000000000000000000000000000", "00000000000000000000000000000000");
140       assertEquals("E08682BE5F2B18A6E8437A15B110D418E08682BE5F2B18A6E8437A15B110D4180143DB63EE66B0CDFF9F69917680151E", string0);
141   }
142
143   @Test(timeout = 4000)
144   public void test11()  throws Throwable  {
145       // Undeclared exception!
146       try { 
147         CryptoUtils.encrypt("", "");
148         fail("Expecting exception: IllegalArgumentException");
149       
150       } catch(IllegalArgumentException e) {
151          //
152          // Empty key
153          //
154          verifyException("javax.crypto.spec.SecretKeySpec", e);
155       }
156   }
157
158   @Test(timeout = 4000)
159   public void test12()  throws Throwable  {
160       CryptoUtils cryptoUtils0 = new CryptoUtils();
161   }
162
163   @Test(timeout = 4000)
164   public void test13()  throws Throwable  {
165       // Undeclared exception!
166       try { 
167         CryptoUtils.decrypt((String) null, "00000000000000000000000000000000");
168         fail("Expecting exception: NullPointerException");
169       
170       } catch(NullPointerException e) {
171          //
172          // no message in exception (getMessage() returned null)
173          //
174          verifyException("org.openecomp.mso.utils.CryptoUtils", e);
175       }
176   }
177 }