summaryrefslogtreecommitdiffstats
path: root/ioam
diff options
context:
space:
mode:
authorJan Srnicek <jsrnicek@cisco.com>2016-11-21 15:06:16 +0100
committerMarek Gradzki <mgradzki@cisco.com>2016-11-24 06:54:46 +0000
commitf698c1ccc38646129ee4a15adacdf47942a24a52 (patch)
tree779e64002860a328f121dc3f2b958b8225c5c0c7 /ioam
parent294d0ea77bd20d580405cc1470dc9a1078be7a5c (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 'ioam')
-rw-r--r--ioam/impl/src/test/java/io/fd/hc2vpp/vppioam/impl/config/IoamTraceWriterCustomizerTest.java59
1 files changed, 27 insertions, 32 deletions
diff --git a/ioam/impl/src/test/java/io/fd/hc2vpp/vppioam/impl/config/IoamTraceWriterCustomizerTest.java b/ioam/impl/src/test/java/io/fd/hc2vpp/vppioam/impl/config/IoamTraceWriterCustomizerTest.java
index 9f5290c6f..c7065c0d5 100644
--- a/ioam/impl/src/test/java/io/fd/hc2vpp/vppioam/impl/config/IoamTraceWriterCustomizerTest.java
+++ b/ioam/impl/src/test/java/io/fd/hc2vpp/vppioam/impl/config/IoamTraceWriterCustomizerTest.java
@@ -16,32 +16,27 @@
package io.fd.hc2vpp.vppioam.impl.config;
-import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
import static org.mockito.Matchers.any;
import static org.mockito.Mockito.doReturn;
import static org.mockito.Mockito.verify;
-import io.fd.honeycomb.translate.write.WriteFailedException;
import io.fd.hc2vpp.common.test.write.WriterCustomizerTest;
-import org.junit.Test;
-import org.mockito.Mock;
-import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
-
+import io.fd.honeycomb.translate.write.WriteFailedException;
import io.fd.vpp.jvpp.ioamtrace.dto.TraceProfileAdd;
import io.fd.vpp.jvpp.ioamtrace.dto.TraceProfileAddReply;
import io.fd.vpp.jvpp.ioamtrace.dto.TraceProfileDel;
import io.fd.vpp.jvpp.ioamtrace.dto.TraceProfileDelReply;
import io.fd.vpp.jvpp.ioamtrace.future.FutureJVppIoamtrace;
-
+import org.junit.Test;
+import org.mockito.Mock;
import org.opendaylight.yang.gen.v1.urn.cisco.params.xml.ns.yang.ioam.sb.trace.rev160512.IoamTraceConfig;
import org.opendaylight.yang.gen.v1.urn.cisco.params.xml.ns.yang.ioam.sb.trace.rev160512.ioam.trace.config.TraceConfig;
+import org.opendaylight.yang.gen.v1.urn.cisco.params.xml.ns.yang.ioam.sb.trace.rev160512.ioam.trace.config.TraceConfig.TraceOp;
import org.opendaylight.yang.gen.v1.urn.cisco.params.xml.ns.yang.ioam.sb.trace.rev160512.ioam.trace.config.TraceConfig.TraceTsp;
import org.opendaylight.yang.gen.v1.urn.cisco.params.xml.ns.yang.ioam.sb.trace.rev160512.ioam.trace.config.TraceConfigBuilder;
-import org.opendaylight.yang.gen.v1.urn.cisco.params.xml.ns.yang.ioam.sb.trace.rev160512.ioam.trace.config.TraceConfig.TraceOp;
-import org.opendaylight.yang.gen.v1.urn.cisco.params.xml.ns.yang.ioam.sb.trace.rev160512.ioam.trace.config.trace.config.NodeInterfaces;
import org.opendaylight.yang.gen.v1.urn.cisco.params.xml.ns.yang.ioam.sb.trace.rev160512.ioam.trace.config.TraceConfigKey;
-import org.opendaylight.yang.gen.v1.urn.cisco.params.xml.ns.yang.ioam.sb.trace.rev160512.ioam.trace.config.trace.config.NodeInterfaces;
+import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
public class IoamTraceWriterCustomizerTest extends WriterCustomizerTest {
@@ -53,11 +48,6 @@ public class IoamTraceWriterCustomizerTest extends WriterCustomizerTest {
private IoamTraceWriterCustomizer customizer;
- @Override
- public void setUp() throws Exception {
- customizer = new IoamTraceWriterCustomizer(jvppIoam);
- }
-
private static TraceConfig generateTraceConfig(final String name) {
final TraceConfigBuilder builder = new TraceConfigBuilder();
builder.setTraceConfigName(name);
@@ -78,6 +68,28 @@ public class IoamTraceWriterCustomizerTest extends WriterCustomizerTest {
.child(TraceConfig.class, new TraceConfigKey(name));
}
+ private static TraceProfileAdd generateTraceProfileAdd() {
+ final TraceProfileAdd request = new TraceProfileAdd();
+ request.traceType = 0x1f;
+ request.numElts = 4;
+ request.nodeId = 1;
+ request.traceTsp = 1;
+ request.appData = 123;
+
+ return request;
+ }
+
+ private static TraceProfileDel generateTraceProfileDel() {
+ final TraceProfileDel request = new TraceProfileDel();
+
+ return request;
+ }
+
+ @Override
+ public void setUpTest() throws Exception {
+ customizer = new IoamTraceWriterCustomizer(jvppIoam);
+ }
+
private void whenTraceAddThenSuccess() {
final TraceProfileAddReply reply = new TraceProfileAddReply();
reply.context = 1;
@@ -98,23 +110,6 @@ public class IoamTraceWriterCustomizerTest extends WriterCustomizerTest {
doReturn(failedFuture()).when(jvppIoam).traceProfileDel(any(TraceProfileDel.class));
}
- private static TraceProfileAdd generateTraceProfileAdd() {
- final TraceProfileAdd request = new TraceProfileAdd();
- request.traceType = 0x1f;
- request.numElts = 4;
- request.nodeId = 1;
- request.traceTsp = 1;
- request.appData = 123;
-
- return request;
- }
-
- private static TraceProfileDel generateTraceProfileDel() {
- final TraceProfileDel request = new TraceProfileDel();
-
- return request;
- }
-
@Test
public void testCreate() throws Exception {
final TraceConfig traceConfig = generateTraceConfig(TRACE_NAME);