1 /*******************************************************************************
2 * ============LICENSE_START====================================================
4 * * ===========================================================================
5 * * Copyright © 2017 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 ******************************************************************************/
22 package org.onap.aaf.auth.rserv.test;
24 import static org.junit.Assert.*;
26 import org.junit.Assert;
27 import org.junit.Before;
28 import org.junit.Test;
29 import org.junit.runner.RunWith;
30 import org.mockito.Matchers;
31 import org.mockito.Mock;
32 import org.onap.aaf.auth.rserv.Version;
33 import org.powermock.modules.junit4.PowerMockRunner;
35 @RunWith(PowerMockRunner.class)
36 public class JU_Version {
43 version = new Version("first\\.123");
44 versionTest = new Version("first\\.124");
48 public void testEquals(){
49 version.equals(versionTest);
50 versionTest.equals(version);
51 versionTest = new Version("fail\\.124");
52 version.equals(versionTest);
53 version.equals("This is not an object of version");
54 versionTest = new Version("NoVersion\\.number");
55 version.equals(versionTest);
61 public void testToString(){
62 String strVal = version.toString();
63 assertNotNull(strVal);
67 public void testHashCode() {
68 Assert.assertNotNull(version.hashCode());