Remove Tabs, per Jococo
[aaf/authz.git] / auth / auth-cass / src / test / java / org / onap / aaf / auth / dao / JU_DAOException.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.auth.dao;
24
25 import static org.junit.Assert.*;
26
27 import org.junit.Before;
28 import org.junit.Test;
29 import org.junit.runner.RunWith;
30 import org.onap.aaf.auth.dao.DAOException;
31 import org.powermock.api.mockito.PowerMockito;
32 import org.powermock.modules.junit4.PowerMockRunner;
33
34 public class JU_DAOException {
35     DAOException daoException;
36
37     String message = "message";
38     Throwable cause;    
39     @Before
40     public void setUp(){
41         daoException = new DAOException();    
42     }
43
44     @Test
45     public void testNoArgConstructor(){
46         assertNull(daoException.getMessage());
47     }
48     
49     @Test
50     public void testOneArgConstructorMsg(){
51         daoException = new DAOException("test message"); 
52         assertTrue("test message".equalsIgnoreCase(daoException.getMessage()));
53     }
54     
55     @Test
56     public void testOneArgConstructorThrowable(){
57         daoException = new DAOException(new Throwable()); 
58         assertTrue("java.lang.Throwable".equalsIgnoreCase(daoException.getMessage()));
59     }
60     
61     @Test
62     public void testTwoArgConstructor(){
63         daoException = new DAOException("test message", new Throwable()); 
64         assertTrue("test message".equalsIgnoreCase(daoException.getMessage()));
65     }
66 }