2 * Copyright © 2017 Red Hat, Inc. and others.
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.genius.mdsalutil.instructions;
10 import static org.junit.Assert.assertEquals;
11 import static org.junit.Assert.assertTrue;
13 import org.junit.Test;
14 import org.opendaylight.genius.mdsalutil.InstructionInfo;
15 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.instruction.GoToTableCase;
16 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.list.Instruction;
19 * Test for {@link InstructionGotoTable}.
21 public class InstructionGotoTableTest {
23 public void newInstruction() {
24 verifyInstructionInfo(new InstructionGotoTable((short) 1));
27 private void verifyInstructionInfo(InstructionInfo instructionInfo) {
28 Instruction instruction = instructionInfo.buildInstruction(2);
29 assertEquals(2, instruction.getKey().getOrder().intValue());
30 assertTrue(instruction.getInstruction() instanceof GoToTableCase);
31 GoToTableCase goToTableCase = (GoToTableCase) instruction.getInstruction();
32 assertEquals((short) 1, goToTableCase.getGoToTable().getTableId().shortValue());