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
commitcf37a5315e7d1961eabf6c4c5b91963b427ca66a (patch)
treefbcf90d1bbaf2b0c36c86095c12db00dd62544f3 /v3po/impl/src/test
parent7ed7491932e1181f6781883b5da1aabe799a87bb (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);