Update MRI projects for Aluminium
[bgpcep.git] / pcep / segment-routing / src / test / java / org / opendaylight / protocol / pcep / segment / routing / PCEPSegmentRoutingCapabilityTest.java
1 /*
2  * Copyright (c) 2014 Cisco 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.protocol.pcep.segment.routing;
9
10 import org.junit.Assert;
11 import org.junit.Test;
12 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.segment.routing.rev181109.sr.pce.capability.tlv.SrPceCapabilityBuilder;
13 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.open.object.open.Tlvs;
14 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.open.object.open.TlvsBuilder;
15 import org.opendaylight.yangtools.yang.common.Uint8;
16
17 public class PCEPSegmentRoutingCapabilityTest {
18     private static final Tlvs EXPECTED_TLVS =
19         new TlvsBuilder().addAugmentation(new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep
20                 .segment.routing.rev181109.Tlvs1Builder().setSrPceCapability(new SrPceCapabilityBuilder()
21                     .setMsd(Uint8.ZERO).build()).build()).build();
22
23     @Test
24     public void testSegmentRoutingCapability() {
25         final PCEPSegmentRoutingCapability sspf = new PCEPSegmentRoutingCapability(true);
26         Assert.assertTrue(sspf.isSegmentRoutingCapable());
27         final TlvsBuilder builder = new TlvsBuilder();
28         sspf.setCapabilityProposal(null, builder);
29         Assert.assertEquals(EXPECTED_TLVS, builder.build());
30     }
31 }