diff options
author | Jan Srnicek <jsrnicek@cisco.com> | 2016-11-21 15:06:16 +0100 |
---|---|---|
committer | Marek Gradzki <mgradzki@cisco.com> | 2016-11-24 06:54:46 +0000 |
commit | f698c1ccc38646129ee4a15adacdf47942a24a52 (patch) | |
tree | 779e64002860a328f121dc3f2b958b8225c5c0c7 /v3po/v3po2vpp/src/test/java/io/fd/hc2vpp/v3po/interfaces/VxlanGpeCustomizerTest.java | |
parent | 294d0ea77bd20d580405cc1470dc9a1078be7a5c (diff) |
HONEYCOMB-275 - compilation error with HC runner and setUp
Refactored setUp() method in WriteCustomizerTest
to not trigger http://errorprone.info/bugpattern/JUnit4SetUpNotRun
while used in combination with @RunWith(HoneycombTestRunner.class)
Change-Id: Iba56b39399ddd7678dda97e094e935a3f02dd22c
Signed-off-by: Jan Srnicek <jsrnicek@cisco.com>
Diffstat (limited to 'v3po/v3po2vpp/src/test/java/io/fd/hc2vpp/v3po/interfaces/VxlanGpeCustomizerTest.java')
-rw-r--r-- | v3po/v3po2vpp/src/test/java/io/fd/hc2vpp/v3po/interfaces/VxlanGpeCustomizerTest.java | 42 |
1 files changed, 21 insertions, 21 deletions
diff --git a/v3po/v3po2vpp/src/test/java/io/fd/hc2vpp/v3po/interfaces/VxlanGpeCustomizerTest.java b/v3po/v3po2vpp/src/test/java/io/fd/hc2vpp/v3po/interfaces/VxlanGpeCustomizerTest.java index 7337c16e3..62da6be03 100644 --- a/v3po/v3po2vpp/src/test/java/io/fd/hc2vpp/v3po/interfaces/VxlanGpeCustomizerTest.java +++ b/v3po/v3po2vpp/src/test/java/io/fd/hc2vpp/v3po/interfaces/VxlanGpeCustomizerTest.java @@ -28,10 +28,13 @@ import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; import com.google.common.net.InetAddresses; -import io.fd.hc2vpp.v3po.DisabledInterfacesManager; +import io.fd.hc2vpp.common.test.write.WriterCustomizerTest; import io.fd.hc2vpp.common.translate.util.NamingContext; +import io.fd.hc2vpp.v3po.DisabledInterfacesManager; import io.fd.honeycomb.translate.write.WriteFailedException; -import io.fd.hc2vpp.common.test.write.WriterCustomizerTest; +import io.fd.vpp.jvpp.VppBaseCallException; +import io.fd.vpp.jvpp.core.dto.VxlanGpeAddDelTunnel; +import io.fd.vpp.jvpp.core.dto.VxlanGpeAddDelTunnelReply; import org.junit.Test; import org.mockito.ArgumentCaptor; import org.mockito.Mock; @@ -46,9 +49,6 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev161214.interfaces._interface.VxlanGpe; import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev161214.interfaces._interface.VxlanGpeBuilder; import org.opendaylight.yangtools.yang.binding.InstanceIdentifier; -import io.fd.vpp.jvpp.VppBaseCallException; -import io.fd.vpp.jvpp.core.dto.VxlanGpeAddDelTunnel; -import io.fd.vpp.jvpp.core.dto.VxlanGpeAddDelTunnelReply; public class VxlanGpeCustomizerTest extends WriterCustomizerTest { @@ -62,8 +62,23 @@ public class VxlanGpeCustomizerTest extends WriterCustomizerTest { private String ifaceName; private InstanceIdentifier<VxlanGpe> id; + private static VxlanGpe generateVxlanGpe(long vni) { + final VxlanGpeBuilder builder = new VxlanGpeBuilder(); + builder.setLocal(new IpAddress(new Ipv4Address("192.168.20.10"))); + builder.setRemote(new IpAddress(new Ipv4Address("192.168.20.11"))); + builder.setVni(new VxlanGpeVni(Long.valueOf(vni))); + builder.setNextProtocol(VxlanGpeNextProtocol.forValue(1)); + builder.setEncapVrfId(Long.valueOf(123)); + builder.setDecapVrfId(Long.valueOf(456)); + return builder.build(); + } + + private static VxlanGpe generateVxlanGpe() { + return generateVxlanGpe(Long.valueOf(11)); + } + @Override - public void setUp() throws Exception { + public void setUpTest() throws Exception { InterfaceTypeTestUtils.setupWriteContext(writeContext, org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev161214.VxlanGpeTunnel.class); NamingContext namingContext = new NamingContext("generateInterfaceName", "test-instance"); @@ -110,21 +125,6 @@ public class VxlanGpeCustomizerTest extends WriterCustomizerTest { assertEquals(DEL_VXLAN_GPE, actual.isAdd); } - private static VxlanGpe generateVxlanGpe(long vni) { - final VxlanGpeBuilder builder = new VxlanGpeBuilder(); - builder.setLocal(new IpAddress(new Ipv4Address("192.168.20.10"))); - builder.setRemote(new IpAddress(new Ipv4Address("192.168.20.11"))); - builder.setVni(new VxlanGpeVni(Long.valueOf(vni))); - builder.setNextProtocol(VxlanGpeNextProtocol.forValue(1)); - builder.setEncapVrfId(Long.valueOf(123)); - builder.setDecapVrfId(Long.valueOf(456)); - return builder.build(); - } - - private static VxlanGpe generateVxlanGpe() { - return generateVxlanGpe(Long.valueOf(11)); - } - @Test public void testWriteCurrentAttributes() throws Exception { final VxlanGpe vxlanGpe = generateVxlanGpe(); |