294bb867683ae93cc05f86e64731e024743f994c
[aaf/authz.git] / cadi / core / src / test / java / org / onap / aaf / cadi / test / JU_CadiException.java
1 /*******************************************************************************
2  * ============LICENSE_START====================================================
3  * * org.onap.aaf
4  * * ===========================================================================
5  * * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
6  * * ===========================================================================
7  * * Licensed under the Apache License, Version 2.0 (the "License");
8  * * you may not use this file except in compliance with the License.
9  * * You may obtain a copy of the License at
10  * * 
11  *  *      http://www.apache.org/licenses/LICENSE-2.0
12  * * 
13  *  * Unless required by applicable law or agreed to in writing, software
14  * * distributed under the License is distributed on an "AS IS" BASIS,
15  * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * * See the License for the specific language governing permissions and
17  * * limitations under the License.
18  * * ============LICENSE_END====================================================
19  * *
20  * *
21  ******************************************************************************/
22
23 package org.onap.aaf.cadi.test;
24
25 import static org.junit.Assert.*;
26
27 import org.junit.Test;
28 import org.onap.aaf.cadi.CadiException;
29
30 import static org.hamcrest.CoreMatchers.is;
31
32 public class JU_CadiException {
33     @Test
34     public void testCadiException() {
35         CadiException exception = new CadiException();
36         
37         assertNotNull(exception);
38     }
39
40     @Test
41     public void testCadiExceptionString() {
42         CadiException exception = new CadiException("New Exception");
43         assertNotNull(exception);
44         assertThat(exception.getMessage(), is("New Exception"));
45     }
46
47     @Test
48     public void testCadiExceptionThrowable() {
49         CadiException exception = new CadiException(new Throwable("New Exception"));
50         assertNotNull(exception);
51         assertThat(exception.getMessage(), is("java.lang.Throwable: New Exception"));
52     }
53
54     @Test
55     public void testCadiExceptionStringThrowable() {
56         CadiException exception = new CadiException("New Exception",new Throwable("New Exception"));
57         assertNotNull(exception);
58         assertThat(exception.getMessage(), is("New Exception"));
59
60     }
61     
62     @Test
63     public void testCadiException1() {
64         CadiException exception = new CadiException();
65         
66         assertNotNull(exception);
67     }
68
69     @Test
70     public void testCadiExceptionString1() {
71         CadiException exception = new CadiException("New Exception");
72         assertNotNull(exception);
73         assertThat(exception.getMessage(), is("New Exception"));
74     }
75
76     @Test
77     public void testCadiExceptionThrowable1() {
78         CadiException exception = new CadiException(new Throwable("New Exception"));
79         assertNotNull(exception);
80         assertThat(exception.getMessage(), is("java.lang.Throwable: New Exception"));
81     }
82
83     @Test
84     public void testCadiExceptionStringThrowable1() {
85         CadiException exception = new CadiException("New Exception",new Throwable("New Exception"));
86         assertNotNull(exception);
87         assertThat(exception.getMessage(), is("New Exception"));
88
89     }
90     
91     @Test
92     public void testCadiException2() {
93         CadiException exception = new CadiException();
94         
95         assertNotNull(exception);
96     }
97
98     @Test
99     public void testCadiExceptionString2() {
100         CadiException exception = new CadiException("New Exception");
101         assertNotNull(exception);
102         assertThat(exception.getMessage(), is("New Exception"));
103     }
104
105     @Test
106     public void testCadiExceptionThrowable2() {
107         CadiException exception = new CadiException(new Throwable("New Exception"));
108         assertNotNull(exception);
109         assertThat(exception.getMessage(), is("java.lang.Throwable: New Exception"));
110     }
111
112     @Test
113     public void testCadiExceptionStringThrowable2() {
114         CadiException exception = new CadiException("New Exception",new Throwable("New Exception"));
115         assertNotNull(exception);
116         assertThat(exception.getMessage(), is("New Exception"));
117
118     }
119
120
121
122 }