26bea9402f6a598d1a5a560d21a80d16ca40222f
[aaf/authz.git] / auth / auth-locate / src / test / java / org / onap / aaf / auth / locate / mapper / JU_Mapper_1_0Test.java
1 /**\r
2  * ============LICENSE_START====================================================\r
3  * org.onap.aaf\r
4  * ===========================================================================\r
5  * Copyright (c) 2018 AT&T Intellectual Property. All rights reserved.\r
6  * ===========================================================================\r
7  * Licensed under the Apache License, Version 2.0 (the "License");\r
8  * you may not use this file except in compliance with the License.\r
9  * You may obtain a copy of the License at\r
10  * \r
11  *      http://www.apache.org/licenses/LICENSE-2.0\r
12  * \r
13  * Unless required by applicable law or agreed to in writing, software\r
14  * distributed under the License is distributed on an "AS IS" BASIS,\r
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
16  * See the License for the specific language governing permissions and\r
17  * limitations under the License.\r
18  * ============LICENSE_END====================================================\r
19  *\r
20  */\r
21 package org.onap.aaf.auth.locate.mapper;\r
22 \r
23 import static org.junit.Assert.assertEquals;\r
24 import static org.junit.Assert.assertTrue;\r
25 \r
26 import org.junit.Before;\r
27 import org.junit.Test;\r
28 import org.onap.aaf.auth.locate.mapper.Mapper.API;\r
29 \r
30 import locate.v1_0.Endpoints;\r
31 import locate.v1_0.MgmtEndpoints;\r
32 import locate_local.v1_0.Error;\r
33 import locate_local.v1_0.InRequest;\r
34 import locate_local.v1_0.Out;\r
35 \r
36 public class JU_Mapper_1_0Test {\r
37 \r
38         @Before\r
39         public void setUp() throws Exception {\r
40 \r
41         }\r
42 \r
43         @Test\r
44         public void testGetClasses() {\r
45                 Mapper_1_1 mapper = new Mapper_1_1();\r
46                 assertEquals(InRequest.class, mapper.getClass(API.IN_REQ));\r
47                 assertEquals(Out.class, mapper.getClass(API.OUT));\r
48                 assertEquals(Error.class, mapper.getClass(API.ERROR));\r
49                 assertEquals(Void.class, mapper.getClass(API.VOID));\r
50                 assertEquals(Endpoints.class, mapper.getClass(API.ENDPOINTS));\r
51                 assertEquals(MgmtEndpoints.class, mapper.getClass(API.MGMT_ENDPOINTS));\r
52         }\r
53 \r
54         @Test\r
55         public void testNewInstance() {\r
56                 Mapper_1_1 mapper = new Mapper_1_1();\r
57                 assertTrue(mapper.newInstance(API.IN_REQ) instanceof InRequest);\r
58                 assertTrue(mapper.newInstance(API.OUT) instanceof Out);\r
59                 assertTrue(mapper.newInstance(API.ERROR) instanceof Error);\r
60                 assertTrue(mapper.newInstance(API.ENDPOINTS) instanceof Endpoints);\r
61                 assertTrue(mapper.newInstance(API.MGMT_ENDPOINTS) instanceof MgmtEndpoints);\r
62                 assertEquals(null, mapper.newInstance(API.VOID));\r
63         }\r
64 \r
65 }\r