AT&T 2.0.19 Code drop, stage 3
[aaf/authz.git] / auth / auth-core / src / test / java / org / onap / aaf / auth / request / test / RoleCompare.java
1 /**
2  * ============LICENSE_START====================================================
3  * org.onap.aaf
4  * ===========================================================================
5  * Copyright (c) 2018 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 package org.onap.aaf.auth.request.test;
23
24 import static junit.framework.Assert.*;
25
26 import java.util.GregorianCalendar;
27
28 import org.onap.aaf.misc.env.util.Chrono;
29
30 import aaf.v2_0.RoleRequest;
31
32 public class RoleCompare extends RosettaCompare<RoleRequest>  {
33         public RoleCompare() {
34                 super(RoleRequest.class);
35         }
36         
37         public static RoleRequest create() {
38                 RoleRequest rr = new RoleRequest();
39                 String in = instance();
40                 rr.setName("org.osaaf.ns.role"+in);
41                 rr.setDescription("Hello World, Role"+in);
42                 GregorianCalendar gc = new GregorianCalendar();
43                 rr.setStart(Chrono.timeStamp(gc));
44                 gc.add(GregorianCalendar.MONTH, 1);
45                 rr.setEnd(Chrono.timeStamp(gc));
46                 return rr;
47         }
48         
49         @Override
50         public void compare(RoleRequest t1, RoleRequest t2) {
51                 assertEquals(t1.getName(),t2.getName());
52                 assertEquals(t1.getDescription(),t2.getDescription());
53                 assertEquals(t1.getStart(),t2.getStart());
54                 assertEquals(t1.getEnd(),t2.getEnd());
55         }
56
57
58         @Override
59         public RoleRequest newOne() {
60                 return create();
61         }
62 }