2 * ============LICENSE_START====================================================
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
11 * http://www.apache.org/licenses/LICENSE-2.0
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====================================================
22 package org.onap.aaf.auth.request.test;
24 import static junit.framework.Assert.*;
26 import java.util.GregorianCalendar;
28 import org.onap.aaf.misc.env.util.Chrono;
30 import aaf.v2_0.UserRoleRequest;
32 public class UserRoleCompare extends RosettaCompare<UserRoleRequest> {
33 public UserRoleCompare() {
34 super(UserRoleRequest.class);
37 public static UserRoleRequest create() {
38 UserRoleRequest urr = new UserRoleRequest();
39 String in = instance();
40 urr.setUser("m125"+in + "@ns.att.com");
41 urr.setRole("org.osaaf.ns.role"+in);
42 GregorianCalendar gc = new GregorianCalendar();
43 urr.setStart(Chrono.timeStamp(gc));
44 gc.add(GregorianCalendar.MONTH, 1);
45 urr.setEnd(Chrono.timeStamp(gc));
50 public void compare(UserRoleRequest t1, UserRoleRequest t2) {
51 assertEquals(t1.getUser(),t2.getUser());
52 assertEquals(t1.getRole(),t2.getRole());
53 assertEquals(t1.getStart(),t2.getStart());
54 assertEquals(t1.getEnd(),t2.getEnd());
59 public UserRoleRequest newOne() {