2 * ============LICENSE_START=======================================================
4 * ================================================================================
5 * Copyright (C) 2019 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=========================================================
21 package org.openecomp.sdc.be.resources.data.auditing;
23 import org.junit.Test;
24 import org.openecomp.sdc.be.resources.data.auditing.model.CommonAuditData;
25 import org.openecomp.sdc.be.resources.data.auditing.model.CommonAuditData.Builder;
27 import java.util.Date;
28 import java.util.UUID;
30 public class AuthEventTest {
32 private AuthEvent createTestSubject() {
33 return new AuthEvent();
37 public void testCtor() throws Exception {
39 Builder newBuilder = CommonAuditData.newBuilder();
40 new AuthEvent("mock", newBuilder.build(), "mock", "mock", "mock", "mock");
44 public void testGetUrl() throws Exception {
45 AuthEvent testSubject;
49 testSubject = createTestSubject();
50 result = testSubject.getUrl();
54 public void testSetUrl() throws Exception {
55 AuthEvent testSubject;
59 testSubject = createTestSubject();
60 testSubject.setUrl(url);
64 public void testGetUser() throws Exception {
65 AuthEvent testSubject;
69 testSubject = createTestSubject();
70 result = testSubject.getUser();
74 public void testSetUser() throws Exception {
75 AuthEvent testSubject;
79 testSubject = createTestSubject();
80 testSubject.setUser(user);
84 public void testGetAuthStatus() throws Exception {
85 AuthEvent testSubject;
89 testSubject = createTestSubject();
90 result = testSubject.getAuthStatus();
94 public void testSetAuthStatus() throws Exception {
95 AuthEvent testSubject;
96 String authStatus = "";
99 testSubject = createTestSubject();
100 testSubject.setAuthStatus(authStatus);
104 public void testGetRealm() throws Exception {
105 AuthEvent testSubject;
109 testSubject = createTestSubject();
110 result = testSubject.getRealm();
114 public void testSetRealm() throws Exception {
115 AuthEvent testSubject;
119 testSubject = createTestSubject();
120 testSubject.setRealm(realm);
124 public void testGetTimebaseduuid() throws Exception {
125 AuthEvent testSubject;
129 testSubject = createTestSubject();
130 result = testSubject.getTimebaseduuid();
134 public void testSetTimebaseduuid() throws Exception {
135 AuthEvent testSubject;
136 UUID timebaseduuid = null;
139 testSubject = createTestSubject();
140 testSubject.setTimebaseduuid(timebaseduuid);
144 public void testGetTimestamp1() throws Exception {
145 AuthEvent testSubject;
149 testSubject = createTestSubject();
150 result = testSubject.getTimestamp1();
154 public void testSetTimestamp1() throws Exception {
155 AuthEvent testSubject;
156 Date timestamp1 = null;
159 testSubject = createTestSubject();
160 testSubject.setTimestamp1(timestamp1);
164 public void testGetAction() throws Exception {
165 AuthEvent testSubject;
169 testSubject = createTestSubject();
170 result = testSubject.getAction();
174 public void testSetAction() throws Exception {
175 AuthEvent testSubject;
179 testSubject = createTestSubject();
180 testSubject.setAction(action);
184 public void testGetStatus() throws Exception {
185 AuthEvent testSubject;
189 testSubject = createTestSubject();
190 result = testSubject.getStatus();
194 public void testSetStatus() throws Exception {
195 AuthEvent testSubject;
199 testSubject = createTestSubject();
200 testSubject.setStatus(status);
204 public void testGetDesc() throws Exception {
205 AuthEvent testSubject;
209 testSubject = createTestSubject();
210 result = testSubject.getDesc();
214 public void testSetDesc() throws Exception {
215 AuthEvent testSubject;
219 testSubject = createTestSubject();
220 testSubject.setDesc(desc);
224 public void testGetRequestId() throws Exception {
225 AuthEvent testSubject;
229 testSubject = createTestSubject();
230 result = testSubject.getRequestId();
234 public void testSetRequestId() throws Exception {
235 AuthEvent testSubject;
236 String requestId = "";
239 testSubject = createTestSubject();
240 testSubject.setRequestId(requestId);
244 public void testFillFields() throws Exception {
245 AuthEvent testSubject;
248 testSubject = createTestSubject();
249 testSubject.fillFields();