8469ad506c265405fd2c5eff703c9aeda8ff9ab2
[so.git] / adapters / mso-adapter-utils / src / test / java / org / onap / so / cloud / authentication / KeystoneAuthHolderTest.java
1 /*-
2  * ============LICENSE_START=======================================================
3  * ONAP - SO
4  * ================================================================================
5  * Copyright (C) 2017 - 2019 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  * ============LICENSE_START==========================================
23  *  ONAP - SO
24  * ===================================================================
25  *  Copyright (c) 2019 IBM.
26  * ===================================================================
27  *  Licensed under the Apache License, Version 2.0 (the "License");
28  *  you may not use this file except in compliance with the License.
29  *  You may obtain a copy of the License at
30  * 
31  *     http://www.apache.org/licenses/LICENSE-2.0
32  * 
33  *  Unless required by applicable law or agreed to in writing, software
34  *  distributed under the License is distributed on an "AS IS" BASIS,
35  *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
36  *  See the License for the specific language governing permissions and
37  *  limitations under the License.
38  * 
39  * ============LICENSE_END=============================================
40  * ====================================================================
41  */
42 package org.onap.so.cloud.authentication;
43
44 import static org.junit.Assert.assertEquals;
45
46 import java.util.Calendar;
47
48 import org.junit.Before;
49 import org.junit.Test;
50
51 public class KeystoneAuthHolderTest {
52
53     private KeystoneAuthHolder keystoneAuthHolder;
54     private Calendar calendar = Calendar.getInstance();
55
56     @Before
57     public void setUp() {
58         keystoneAuthHolder = new KeystoneAuthHolder();
59     }
60
61     @Test
62     public void testGetId() {
63         keystoneAuthHolder.setId("001");
64         assertEquals("001", keystoneAuthHolder.getId());
65     }
66
67     @Test
68     public void testGetexpiration() {
69         keystoneAuthHolder.setexpiration(calendar);
70         assertEquals(calendar, keystoneAuthHolder.getexpiration());
71     }
72
73     @Test
74     public void testGetServiceUrl() {
75         keystoneAuthHolder.setHeatUrl("testURL");
76         assertEquals("testURL", keystoneAuthHolder.getServiceUrl());
77     }
78
79 }