diff options
Diffstat (limited to 'ioam/impl/src')
-rw-r--r-- | ioam/impl/src/test/java/io/fd/hc2vpp/vppioam/impl/config/IoamTraceWriterCustomizerTest.java | 59 |
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); |