OpenDaylight Networking SFC Port Pair Group REST APIs
[neutron.git] / neutron-spi / src / test / java / org / opendaylight / neutron / spi / NeutronSFCPortPairGroupJAXBTest.java
1 /*
2  * Copyright (c) 2016 Brocade Communications Systems, Inc. and others.  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 package org.opendaylight.neutron.spi;
9
10 import org.junit.Assert;
11 import org.junit.Test;
12
13 import javax.xml.bind.JAXBException;
14
15 /**
16  * Created by Anil Vishnoi (avishnoi@Brocade.com)
17  */
18 public class NeutronSFCPortPairGroupJAXBTest {
19     private static final String NeutronSFCPortPairGroup_sourceJson = "{ "
20             + "\"name\": \"portpair1\", "
21             + "\"port_pairs\": [ "
22             + "\"d11e9190-73d4-11e5-b392-2c27d72acb4c\""
23             + "], "
24             + "\"tenant_id\": \"4969c491a3c74ee4af974e6d800c62de\", "
25             + "\"id\": \"4e8e5957-649f-477b-9e5b-f1f75b21c03c\" }";
26
27     @Test
28     public void test_NeutronSFCPortPairGroup_JAXB() throws JAXBException {
29         NeutronSFCPortPairGroup testObject = new NeutronSFCPortPairGroup();
30         NeutronSFCPortPairGroup neutronObject
31                 = (NeutronSFCPortPairGroup) JaxbTestHelper.jaxbUnmarshall(testObject
32                 , NeutronSFCPortPairGroup_sourceJson);
33
34         Assert.assertEquals("NeutronSFCPortPairGroup JAXB Test 1: Testing id failed"
35                 , "4e8e5957-649f-477b-9e5b-f1f75b21c03c",neutronObject.getID());
36
37         Assert.assertEquals("NeutronSFCPortPairGroup JAXB Test 2: Testing tenant_id failed",
38                 "4969c491a3c74ee4af974e6d800c62de", neutronObject.getTenantID());
39
40         Assert.assertEquals("NeutronSFCPortPairGroup JAXB Test 3: Testing port_pairs failed",
41                 "d11e9190-73d4-11e5-b392-2c27d72acb4c", neutronObject.getPortPairs().get(0));
42     }
43 }