summaryrefslogtreecommitdiffstats
path: root/v3po/data-impl/src/test
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
commit152ec1037001b867890aaaffe8a9e38a85b501b2 (patch)
treed94ccb141cb2f83020253390d90a2578c67a9386 /v3po/data-impl/src/test
parentc4c4334ef4db37af07025523de4c2e2e25763599 (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')
-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);