summaryrefslogtreecommitdiffstats
path: root/v3po/data-impl/src/test/java
diff options
context:
space:
mode:
authorMaros Marsalek <mmarsale@cisco.com>2016-04-12 16:19:31 +0200
committerMaros Marsalek <mmarsale@cisco.com>2016-04-13 08:19:15 +0200
commit85e8751ceb79ed8ed8eadfe70c9568b7741449f9 (patch)
tree9c53b41ff567f465d17dcd19b65653330506c4b0 /v3po/data-impl/src/test/java
parent24a6bf1fee7871fb9c93d277c5d676a48de0cf67 (diff)
HONEYCOMB-8: Fix netconf monitoring operational data provisioning
Local storage for netconf monitoring was not wired with netconf northbound for vpp. Change-Id: I864614ffcbf7acf16eccc65ab58b9821b2682f93 Signed-off-by: Maros Marsalek <mmarsale@cisco.com>
Diffstat (limited to 'v3po/data-impl/src/test/java')
-rw-r--r--v3po/data-impl/src/test/java/io/fd/honeycomb/v3po/data/impl/OperationalDataTreeTest.java18
1 files changed, 16 insertions, 2 deletions
diff --git a/v3po/data-impl/src/test/java/io/fd/honeycomb/v3po/data/impl/OperationalDataTreeTest.java b/v3po/data-impl/src/test/java/io/fd/honeycomb/v3po/data/impl/OperationalDataTreeTest.java
index fbd512915..7e6abcdcd 100644
--- a/v3po/data-impl/src/test/java/io/fd/honeycomb/v3po/data/impl/OperationalDataTreeTest.java
+++ b/v3po/data-impl/src/test/java/io/fd/honeycomb/v3po/data/impl/OperationalDataTreeTest.java
@@ -34,15 +34,20 @@ import com.google.common.collect.Iterables;
import com.google.common.collect.LinkedListMultimap;
import com.google.common.collect.Multimap;
import com.google.common.util.concurrent.CheckedFuture;
+import com.google.common.util.concurrent.Futures;
import io.fd.honeycomb.v3po.translate.read.ReadContext;
import io.fd.honeycomb.v3po.translate.read.ReaderRegistry;
+import java.util.Collections;
import java.util.Map;
import org.junit.Before;
import org.junit.Test;
import org.mockito.Mock;
+import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
import org.opendaylight.controller.md.sal.common.api.data.ReadFailedException;
-import org.opendaylight.yangtools.binding.data.codec.api.BindingNormalizedNodeSerializer;
+import org.opendaylight.controller.md.sal.dom.api.DOMDataBroker;
+import org.opendaylight.controller.md.sal.dom.api.DOMDataReadOnlyTransaction;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev150105.VppState;
+import org.opendaylight.yangtools.binding.data.codec.api.BindingNormalizedNodeSerializer;
import org.opendaylight.yangtools.yang.binding.DataObject;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
import org.opendaylight.yangtools.yang.common.QName;
@@ -72,12 +77,20 @@ public class OperationalDataTreeTest {
private DataSchemaNode schemaNode;
@Mock
private ReadContext readCtx;
+ @Mock
+ private DOMDataBroker netconfMonitoringBroker;
+ @Mock
+ private DOMDataReadOnlyTransaction domDataReadOnlyTransaction;
@Before
public void setUp() {
initMocks(this);
- operationalData = new OperationalDataTree(serializer, globalContext, reader);
+ operationalData = new OperationalDataTree(serializer, globalContext, reader, netconfMonitoringBroker);
doReturn(schemaNode).when(globalContext).getDataChildByName(any(QName.class));
+
+ doReturn(domDataReadOnlyTransaction).when(netconfMonitoringBroker).newReadOnlyTransaction();
+ doReturn(Futures.immediateCheckedFuture(Optional.absent())).when(domDataReadOnlyTransaction)
+ .read(any(LogicalDatastoreType.class), any(YangInstanceIdentifier.class));
}
@Test
@@ -85,6 +98,7 @@ public class OperationalDataTreeTest {
final YangInstanceIdentifier yangId = mock(YangInstanceIdentifier.class);
final YangInstanceIdentifier.PathArgument pArg = mock(YangInstanceIdentifier.PathArgument.class);
doReturn(pArg).when(yangId).getLastPathArgument();
+ doReturn(Collections.singletonList(pArg)).when(yangId).getPathArguments();
doReturn(QName.create("namespace", "2012-12-12", "local")).when(pArg).getNodeType();
doReturn(id).when(serializer).fromYangInstanceIdentifier(yangId);