JUnits for Mapper_2_0
[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 \r
22 package org.onap.aaf.auth.locate.mapper;\r
23 \r
24 import static org.junit.Assert.assertEquals;\r
25 import static org.junit.Assert.assertTrue;\r
26 \r
27 import org.junit.Before;\r
28 import org.junit.Test;\r
29 import org.onap.aaf.auth.locate.mapper.Mapper.API;\r
30 \r
31 import locate.v1_0.Endpoints;\r
32 import locate.v1_0.MgmtEndpoints;\r
33 import locate_local.v1_0.Error;\r
34 import locate_local.v1_0.InRequest;\r
35 import locate_local.v1_0.Out;\r
36 \r
37 public class JU_Mapper_1_0Test {\r
38 \r
39     @Before\r
40     public void setUp() throws Exception {\r
41 \r
42     }\r
43 \r
44     @Test\r
45     public void testGetClasses() {\r
46         Mapper_1_1 mapper = new Mapper_1_1();\r
47         assertEquals(InRequest.class, mapper.getClass(API.IN_REQ));\r
48         assertEquals(Out.class, mapper.getClass(API.OUT));\r
49         assertEquals(Error.class, mapper.getClass(API.ERROR));\r
50         assertEquals(Void.class, mapper.getClass(API.VOID));\r
51         assertEquals(Endpoints.class, mapper.getClass(API.ENDPOINTS));\r
52         assertEquals(MgmtEndpoints.class, mapper.getClass(API.MGMT_ENDPOINTS));\r
53     }\r
54 \r
55     @Test\r
56     public void testNewInstance() {\r
57         Mapper_1_1 mapper = new Mapper_1_1();\r
58         assertTrue(mapper.newInstance(API.IN_REQ) instanceof InRequest);\r
59         assertTrue(mapper.newInstance(API.OUT) instanceof Out);\r
60         assertTrue(mapper.newInstance(API.ERROR) instanceof Error);\r
61         assertTrue(mapper.newInstance(API.ENDPOINTS) instanceof Endpoints);\r
62         assertTrue(mapper.newInstance(API.MGMT_ENDPOINTS) instanceof MgmtEndpoints);\r
63         assertEquals(null, mapper.newInstance(API.VOID));\r
64     }\r
65 \r
66 }\r