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