Added support for Multiple Edges
[aai/aai-common.git] / aai-core / src / test / java / org / onap / aai / util / FormatDateTest.java
1 /*-
2  * ============LICENSE_START=======================================================
3  * org.onap.aai
4  * ================================================================================
5  * Copyright (C) 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 package org.onap.aai.util;
22
23
24 import java.time.zone.ZoneRulesException;
25
26 import org.junit.Assert;
27 import org.junit.Ignore;
28 import org.junit.Test;
29
30 @Ignore
31 public class FormatDateTest {
32
33
34         @Test(expected=IllegalArgumentException.class)
35         public void testExceptionThrownWhenInvalidPatternIsPassed()
36         {
37                 FormatDate formatDate = new FormatDate("XX/TT/GGGG");
38                 formatDate.getDateTime();
39         }
40         
41         @Test
42         public void correctPattern()
43         {
44                 FormatDate formatDate = new FormatDate("dd/mm/yyyy");
45                 Assert.assertNotNull(formatDate.getDateTime());
46         }
47         
48         @Test(expected=IllegalArgumentException.class)
49         public void invalidPattern()
50         {
51                 FormatDate formatDate = new FormatDate("XX/TT/GGGG","GMT");
52                 formatDate.getDateTime();
53         }
54         
55         @Test(expected=ZoneRulesException.class)
56         public void invalidZone()
57         {
58                 FormatDate formatDate = new FormatDate("dd/mm/yyyy","IST");
59                 formatDate.getDateTime();
60         }
61         
62         @Test(expected=IllegalArgumentException.class)
63         public void testExceptionThrownWhenInvalidPatternAndZoneIsPassed()
64         {
65                 FormatDate formatDate = new FormatDate("XX/TT/GGGG","IST");
66                 formatDate.getDateTime();
67         }
68         
69         @Test
70         public void correctPatternAndZone()
71         {
72                 FormatDate formatDate = new FormatDate("dd/mm/yyyy","GMT");
73                 Assert.assertNotNull(formatDate.getDateTime());
74         }
75 }