/* * Copyright (c) 2018 AT&T Intellectual Property. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v1.0 which accompanies this distribution, * and is available at http://www.eclipse.org/legal/epl-v10.html */ package org.opendaylight.protocol.bgp.route.targetcontrain.impl.activators; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNull; import static org.opendaylight.protocol.bgp.route.targetcontrain.impl.activators.BGPActivator.RT_SAFI; import org.junit.Test; import org.opendaylight.protocol.bgp.parser.spi.BGPExtensionProviderContext; import org.opendaylight.protocol.bgp.parser.spi.pojo.SimpleBGPExtensionProviderContext; import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.route.target.constrain.rev180618.RouteTargetConstrainSubsequentAddressFamily; public final class BGPActivatorTest { @Test public void testActivator() { final BGPActivator act = new BGPActivator(); final BGPExtensionProviderContext context = new SimpleBGPExtensionProviderContext(); assertNull(context.getSubsequentAddressFamilyRegistry().classForFamily(RT_SAFI)); act.start(context); assertEquals(RouteTargetConstrainSubsequentAddressFamily.class, context.getSubsequentAddressFamilyRegistry() .classForFamily(RT_SAFI)); act.close(); } }