checkstyle: TypeName
[neutron.git] / neutron-spi / src / test / java / org / opendaylight / neutron / spi / NeutronRouterInterfaceJAXBTest.java
1 /*
2  * Copyright (c) 2015 Tata Consultancy Services.  All rights reserved.
3  *
4  * This program and the accompanying materials are made available under the
5  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6  * and is available at http://www.eclipse.org/legal/epl-v10.html
7  */
8
9 package org.opendaylight.neutron.spi;
10
11 import javax.xml.bind.JAXBException;
12 import org.junit.Assert;
13 import org.junit.Test;
14
15 public class NeutronRouterInterfaceJAXBTest {
16     private static final String NEUTRON_ROUTER_INTERFACE_SOURCE_JSON = "{"
17             + "\"subnet_id\": \"3b80198d-4f7b-4f77-9ef5-774d54e17126\", "
18             + "\"port_id\": \"65c0ee9f-d634-4522-8954-51021b570b0d\", "
19             + "\"id\": \"7370da7f-234e-3f7a-ed12-e384131d886d\" }";
20
21     @Test
22     public void test_NeutronRouterInterface_JAXB() throws JAXBException {
23         NeutronRouterInterface dummyObject = new NeutronRouterInterface();
24
25         NeutronRouterInterface testObject = (NeutronRouterInterface) JaxbTestHelper.jaxbUnmarshall(dummyObject,
26                 NEUTRON_ROUTER_INTERFACE_SOURCE_JSON);
27
28         Assert.assertEquals("NeutronRouterInterface JAXB Test 1: Testing subnet_id failed",
29                 "3b80198d-4f7b-4f77-9ef5-774d54e17126", testObject.getSubnetUUID());
30
31         Assert.assertEquals("NeutronRouterInterface JAXB Test 2: Testing port_id failed",
32                 "65c0ee9f-d634-4522-8954-51021b570b0d", testObject.portUUID);
33
34         Assert.assertEquals("NeutronRouterInterface JAXB Test 3: Testing id failed",
35                 "7370da7f-234e-3f7a-ed12-e384131d886d", testObject.getID());
36     }
37 }