MRI version bump for Aluminium
[genius.git] / mdsalutil / mdsalutil-api / src / test / java / org / opendaylight / genius / mdsalutil / actions / ActionNxConntrackTest.java
1 /*
2  * Copyright (c) 2018 Red Hat, 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.genius.mdsalutil.actions;
9
10 import static com.google.common.truth.Truth.assertThat;
11
12 import ch.vorburger.xtendbeans.XtendBeanGenerator;
13 import org.junit.Test;
14 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddressBuilder;
15
16 /**
17  * Unit Test for {@link ActionNxConntrack}.
18  *
19  * @author Michael Vorburger.ch
20  */
21 public class ActionNxConntrackTest {
22
23     private final XtendBeanGenerator generator = new XtendBeanGenerator();
24
25     @Test
26     public void testNxCtMark() {
27         assertThat(generator.getExpression(new ActionNxConntrack.NxCtMark(123))).isEqualTo("new NxCtMark(123L)");
28     }
29
30     @Test
31     public void testNxNat() {
32         assertThat(new ActionNxConntrack.NxNat(123, 456, 789,
33                 IpAddressBuilder.getDefaultInstance("1.2.3.4"),
34                 IpAddressBuilder.getDefaultInstance("1.2.3.4"), 987, 654).toString()
35                 .equals("new NxNat(123, 456, 789, new IpAddress(new Ipv4Address(\"1.2.3.4\")), "
36                 + "new IpAddress(new Ipv4Address(\"1.2.3.4\")), 987, 654)"));
37     }
38
39 }