e2167a9fe46ded805904a17ff1899a637b555371
[portal/sdk.git] /
1 /*
2  * ============LICENSE_START==========================================
3  * ONAP Portal SDK
4  * ===================================================================
5  * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
6  * ===================================================================
7  *
8  * Unless otherwise specified, all software contained herein is licensed
9  * under the Apache License, Version 2.0 (the "License");
10  * you may not use this software except in compliance with the License.
11  * You may obtain a copy of the License at
12  *
13  *             http://www.apache.org/licenses/LICENSE-2.0
14  *
15  * Unless required by applicable law or agreed to in writing, software
16  * distributed under the License is distributed on an "AS IS" BASIS,
17  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18  * See the License for the specific language governing permissions and
19  * limitations under the License.
20  *
21  * Unless otherwise specified, all documentation contained herein is licensed
22  * under the Creative Commons License, Attribution 4.0 Intl. (the "License");
23  * you may not use this documentation except in compliance with the License.
24  * You may obtain a copy of the License at
25  *
26  *             https://creativecommons.org/licenses/by/4.0/
27  *
28  * Unless required by applicable law or agreed to in writing, documentation
29  * distributed under the License is distributed on an "AS IS" BASIS,
30  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
31  * See the License for the specific language governing permissions and
32  * limitations under the License.
33  *
34  * ============LICENSE_END============================================
35  *
36  * ECOMP is a trademark and service mark of AT&T Intellectual Property.
37  */
38 package org.onap.portalsdk.analytics.system.fusion.domain;
39
40 import static org.junit.Assert.*;
41
42 import org.junit.Test;
43
44 public class CR_ReportTest {
45         
46         public CR_Report mockCR_ReportTest() {
47                 CR_Report cR_Report = new CR_Report();
48                 cR_Report.setTitle("test");
49                 cR_Report.setDescr("descr");
50                 cR_Report.setPublic_yn("public_yn");
51                 cR_Report.setCreateDate(null);
52                 cR_Report.setMaintDate(null);
53                 cR_Report.setMenuId(null);
54                 cR_Report.setMenuApproved_YN("menuApproved_YN");
55                 cR_Report.setOwnerId(null);
56                 cR_Report.setFolderId((long) 1);
57                 cR_Report.setDashboard_yn("dashboard_yn");
58                 cR_Report.setCreated(null);
59                 cR_Report.setMaintId(null);
60                 cR_Report.setDashboard_type_YN(null);
61                 cR_Report.setCreateId(null);
62                 return cR_Report;
63         }
64     @Test
65         public void cR_ReportTest()
66         {
67         CR_Report cR_Report = mockCR_ReportTest();
68         CR_Report cR_Report1 = mockCR_ReportTest();
69         assertEquals(cR_Report.getTitle(), cR_Report1.getTitle());
70         assertEquals(cR_Report.getDescr(), cR_Report1.getDescr());
71         assertEquals(cR_Report.getPublic_yn(), cR_Report1.getPublic_yn());
72         assertEquals(cR_Report.getCreateDate(), cR_Report1.getCreateDate());
73         assertEquals(cR_Report.getMaintDate(), cR_Report1.getMaintDate());
74         assertEquals(cR_Report.getMenuId(), cR_Report1.getMenuId());
75         assertEquals(cR_Report.getMenuApproved_YN(), cR_Report1.getMenuApproved_YN());
76         assertEquals(cR_Report.getOwnerId(), cR_Report1.getOwnerId());
77         assertEquals(cR_Report.getFolderId(), cR_Report1.getFolderId());
78         assertEquals(cR_Report.getDashboard_yn(), cR_Report1.getDashboard_yn());
79         assertEquals(cR_Report.getCreated(), cR_Report1.getCreated());
80         assertEquals(cR_Report.getMaintId(), cR_Report1.getMaintId());
81         assertEquals(cR_Report.getCreateId(), cR_Report1.getCreateId());
82         assertNull(cR_Report.getDashboard_type_YN());
83         assertNull(cR_Report.getCreated());
84
85         }
86     @Test
87     public void compareToTest()
88     {
89         CR_Report cR_Report = mockCR_ReportTest();
90         CR_Report cR_Report1 = mockCR_ReportTest();
91         cR_Report1.setTitle(null);
92         assertEquals(cR_Report.compareTo(cR_Report1),1);
93         assertEquals(cR_Report1.compareTo(cR_Report),1);
94         cR_Report1.setTitle("test");
95         assertEquals(cR_Report1.compareTo(cR_Report),0);
96     }
97 }