summaryrefslogtreecommitdiffstats
path: root/v3po/impl/src/test
diff options
context:
space:
mode:
authorMaros Marsalek <mmarsale@cisco.com>2016-02-18 17:02:26 +0100
committerMaros Marsalek <mmarsale@cisco.com>2016-02-18 17:30:40 +0100
commit89fd34ab4d8c082e7d89af4edaa48f6022581854 (patch)
tree548ac2634888085acf5bac9e58b4aec3c83c477a /v3po/impl/src/test
parented2805a57ca103d82092b6758c54d505568d312a (diff)
Initialize v3po data structures
This is a workaround to avoid posible DataTree exception when submitting new interface configuration without pre-existing day0 configuration. Applies for all list nodes and a proper fix will follow in ODL. Change-Id: I6ee6e7ae189542d5ae2ad742f431b88745c42c4d Signed-off-by: Maros Marsalek <mmarsale@cisco.com>
Diffstat (limited to 'v3po/impl/src/test')
-rw-r--r--v3po/impl/src/test/java/org/opendaylight/yang/gen/v1/urn/opendaylight/params/xml/ns/yang/v3po/impl/rev141210/V3poModuleTest.java23
1 files changed, 13 insertions, 10 deletions
diff --git a/v3po/impl/src/test/java/org/opendaylight/yang/gen/v1/urn/opendaylight/params/xml/ns/yang/v3po/impl/rev141210/V3poModuleTest.java b/v3po/impl/src/test/java/org/opendaylight/yang/gen/v1/urn/opendaylight/params/xml/ns/yang/v3po/impl/rev141210/V3poModuleTest.java
index 99872549a..cee38b287 100644
--- a/v3po/impl/src/test/java/org/opendaylight/yang/gen/v1/urn/opendaylight/params/xml/ns/yang/v3po/impl/rev141210/V3poModuleTest.java
+++ b/v3po/impl/src/test/java/org/opendaylight/yang/gen/v1/urn/opendaylight/params/xml/ns/yang/v3po/impl/rev141210/V3poModuleTest.java
@@ -15,21 +15,20 @@
*/
package org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.impl.rev141210;
-import org.junit.Test;
-import org.opendaylight.controller.config.api.DependencyResolver;
-import org.opendaylight.controller.config.api.JmxAttribute;
-import org.opendaylight.controller.config.api.ModuleIdentifier;
-import org.opendaylight.controller.sal.binding.api.BindingAwareBroker;
-import io.fd.honeycomb.v3po.impl.V3poProvider;
-
-import javax.management.ObjectName;
-
import static org.mockito.Matchers.any;
import static org.mockito.Matchers.eq;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
+import io.fd.honeycomb.v3po.impl.V3poProvider;
+import javax.management.ObjectName;
+import org.junit.Test;
+import org.opendaylight.controller.config.api.DependencyResolver;
+import org.opendaylight.controller.config.api.JmxAttribute;
+import org.opendaylight.controller.config.api.ModuleIdentifier;
+import org.opendaylight.controller.sal.binding.api.BindingAwareBroker;
+
public class V3poModuleTest {
@Test
public void testCustomValidation() {
@@ -45,7 +44,11 @@ public class V3poModuleTest {
// configure mocks
DependencyResolver dependencyResolver = mock(DependencyResolver.class);
BindingAwareBroker broker = mock(BindingAwareBroker.class);
- when(dependencyResolver.resolveInstance(eq(BindingAwareBroker.class), any(ObjectName.class), any(JmxAttribute.class))).thenReturn(broker);
+ when(dependencyResolver.resolveInstance(eq(BindingAwareBroker.class), any(ObjectName.class), any(JmxAttribute.class)))
+ .thenReturn(broker);
+ final org.opendaylight.controller.sal.core.api.Broker domBroker = mock(org.opendaylight.controller.sal.core.api.Broker.class);
+ when(dependencyResolver.resolveInstance(eq(org.opendaylight.controller.sal.core.api.Broker.class), any(ObjectName.class), any(JmxAttribute.class)))
+ .thenReturn(domBroker);
// create instance of module with injected mocks
V3poModule module = new V3poModule(mock(ModuleIdentifier.class), dependencyResolver);