2 * ============LICENSE_START==========================================
4 * ===================================================================
5 * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
6 * ===================================================================
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
13 * http://www.apache.org/licenses/LICENSE-2.0
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.
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
26 * https://creativecommons.org/licenses/by/4.0/
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.
34 * ============LICENSE_END============================================
36 * ECOMP is a trademark and service mark of AT&T Intellectual Property.
38 package org.onap.portalsdk.analytics.system.fusion.domain;
40 import static org.junit.Assert.*;
42 import org.junit.Test;
44 public class CR_ReportTest {
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);
65 public void cR_ReportTest()
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());
87 public void compareToTest()
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);