summaryrefslogtreecommitdiffstats
path: root/v3po/impl/src/test
diff options
context:
space:
mode:
authorMarek Gradzki <mgradzki@cisco.com>2016-04-10 22:06:36 +0200
committerMarek Gradzki <mgradzki@cisco.com>2016-04-12 10:59:14 +0200
commit6dcea1de979536dbe0478e31f17191bcfae92f3c (patch)
treea5070e77f1de0c17476a33aeaaa68fc21ba4315a /v3po/impl/src/test
parent4ebc67b58e0172bd4f5704e52a10714ee64d7d07 (diff)
HONEYCOMB-34: Configurable serializer dependency
Change-Id: I05cb7836ec4a379f7617710a6c6f64c3541ff0c9 Signed-off-by: Marek Gradzki <mgradzki@cisco.com>
Diffstat (limited to 'v3po/impl/src/test')
-rw-r--r--v3po/impl/src/test/java/io/fd/honeycomb/v3po/impl/data/VppDataBrokerInitializationProviderTest.java5
-rw-r--r--v3po/impl/src/test/java/org/opendaylight/yang/gen/v1/urn/opendaylight/params/xml/ns/yang/v3po/impl/rev141210/V3poModuleTest.java9
2 files changed, 13 insertions, 1 deletions
diff --git a/v3po/impl/src/test/java/io/fd/honeycomb/v3po/impl/data/VppDataBrokerInitializationProviderTest.java b/v3po/impl/src/test/java/io/fd/honeycomb/v3po/impl/data/VppDataBrokerInitializationProviderTest.java
index d8628f2bf..eb2349fb2 100644
--- a/v3po/impl/src/test/java/io/fd/honeycomb/v3po/impl/data/VppDataBrokerInitializationProviderTest.java
+++ b/v3po/impl/src/test/java/io/fd/honeycomb/v3po/impl/data/VppDataBrokerInitializationProviderTest.java
@@ -36,6 +36,7 @@ import org.opendaylight.controller.md.sal.binding.api.DataBroker;
import org.opendaylight.controller.md.sal.binding.api.WriteTransaction;
import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
import org.opendaylight.controller.md.sal.common.api.data.TransactionCommitFailedException;
+import org.opendaylight.yangtools.binding.data.codec.api.BindingNormalizedNodeSerializer;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
public class VppDataBrokerInitializationProviderTest {
@@ -48,6 +49,8 @@ public class VppDataBrokerInitializationProviderTest {
private ReaderRegistry readerRegistry;
@Mock
private WriterRegistry writerRegistry;
+ @Mock
+ private BindingNormalizedNodeSerializer serializer;
private VppDataBrokerInitializationProvider provider;
@@ -56,7 +59,7 @@ public class VppDataBrokerInitializationProviderTest {
public void setUp() throws Exception {
initMocks(this);
doReturn(writeTx).when(bindingBroker).newWriteOnlyTransaction();
- provider = new VppDataBrokerInitializationProvider(bindingBroker, readerRegistry, writerRegistry);
+ provider = new VppDataBrokerInitializationProvider(bindingBroker, readerRegistry, writerRegistry, serializer);
}
@Test
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 74d36bb9d..6eef488cc 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
@@ -22,12 +22,15 @@ import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
import io.fd.honeycomb.v3po.impl.V3poProvider;
+import io.fd.honeycomb.v3po.translate.read.ReaderRegistry;
+import io.fd.honeycomb.v3po.translate.write.WriterRegistry;
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;
+import org.opendaylight.yangtools.binding.data.codec.api.BindingNormalizedNodeSerializer;
public class V3poModuleTest {
@Test
@@ -50,6 +53,12 @@ public class V3poModuleTest {
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);
+ when(dependencyResolver.resolveInstance(eq(ReaderRegistry.class), any(ObjectName.class), any(JmxAttribute.class)))
+ .thenReturn(mock(ReaderRegistry.class));
+ when(dependencyResolver.resolveInstance(eq(WriterRegistry.class), any(ObjectName.class), any(JmxAttribute.class)))
+ .thenReturn(mock(WriterRegistry.class));
+ when(dependencyResolver.resolveInstance(eq(BindingNormalizedNodeSerializer.class), any(ObjectName.class), any(JmxAttribute.class)))
+ .thenReturn(mock(BindingNormalizedNodeSerializer.class));
// create instance of module with injected mocks
V3poModule module = new V3poModule(mock(ModuleIdentifier.class), dependencyResolver);