2 * Copyright (c) 2015 Cisco Systems, Inc. and others. All rights reserved.
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
8 package org.opendaylight.openflowplugin.impl.registry.flow;
10 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
11 import org.junit.Assert;
12 import org.junit.Test;
13 import org.opendaylight.openflowplugin.api.openflow.registry.flow.FlowDescriptor;
14 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowId;
15 import org.opendaylight.yangtools.yang.common.Uint8;
18 * Test for {@link FlowDescriptorFactory.FlowDescriptorDto}.
20 public class FlowDescriptorDtoTest {
23 public void testCreate() {
24 final FlowDescriptor flowDescriptor = FlowDescriptorFactory.create(Uint8.ONE, new FlowId("unit:1"));
25 Assert.assertNotNull(flowDescriptor);
26 Assert.assertNotNull(flowDescriptor.getFlowId());
27 Assert.assertNotNull(flowDescriptor.getTableKey());
30 @Test(expected = Exception.class)
31 @SuppressFBWarnings(value = "NP_NONNULL_PARAM_VIOLATION", justification = "that is the point of this test")
32 public void testCreateNegative1() {
33 FlowDescriptorFactory.create(Uint8.ONE, null);