import org.mockito.ArgumentMatcher;
import org.mockito.Mock;
import org.opendaylight.controller.cluster.schema.provider.impl.YangTextSchemaSourceSerializationProxy;
+import org.opendaylight.controller.md.sal.binding.api.DataBroker;
import org.opendaylight.controller.md.sal.dom.api.DOMDataBroker;
+import org.opendaylight.controller.md.sal.dom.api.DOMMountPointService;
import org.opendaylight.controller.md.sal.dom.api.DOMRpcException;
import org.opendaylight.controller.md.sal.dom.api.DOMRpcResult;
import org.opendaylight.controller.md.sal.dom.api.DOMRpcService;
import org.opendaylight.controller.md.sal.dom.spi.DefaultDOMRpcResult;
-import org.opendaylight.controller.sal.core.api.Broker;
import org.opendaylight.netconf.sal.connect.util.RemoteDeviceId;
import org.opendaylight.netconf.topology.singleton.impl.actors.NetconfNodeActor;
import org.opendaylight.netconf.topology.singleton.impl.utils.ClusteringRpcException;
@Mock
private DOMRpcService domRpcService;
+ @Mock
+ private DOMMountPointService mountPointService;
+ @Mock
+ private DataBroker dataBroker;
@Before
public void setup() throws UnknownHostException {
final NetconfTopologySetup setup = mock(NetconfTopologySetup.class);
final Props props = NetconfNodeActor.props(setup, remoteDeviceId, DEFAULT_SCHEMA_REPOSITORY,
- DEFAULT_SCHEMA_REPOSITORY, TIMEOUT);
+ DEFAULT_SCHEMA_REPOSITORY, TIMEOUT, mountPointService);
system = ActorSystem.create();
@Test
public void testReceiveRegisterMountpoint() throws Exception {
final NetconfTopologySetup setup = mock(NetconfTopologySetup.class);
- doReturn(mock(Broker.class)).when(setup).getDomBroker();
final RevisionSourceIdentifier yang1 = RevisionSourceIdentifier.create("yang1");
final RevisionSourceIdentifier yang2 = RevisionSourceIdentifier.create("yang2");
final SchemaSourceRegistry registry = mock(SchemaSourceRegistry.class);
Futures.makeChecked(schemaContextFuture, e -> new SchemaResolutionException("fail", e));
doReturn(checkedFuture).when(schemaContextFactory).createSchemaContext(any());
final ActorRef slaveRef =
- system.actorOf(NetconfNodeActor.props(setup, remoteDeviceId, registry, schemaRepository, TIMEOUT));
+ system.actorOf(NetconfNodeActor.props(setup, remoteDeviceId, registry, schemaRepository, TIMEOUT,
+ mountPointService));
final List<SourceIdentifier> sources = ImmutableList.of(yang1, yang2);
slaveRef.tell(new RegisterMountPoint(sources), masterRef);
final SchemaRepository schemaRepository = mock(SchemaRepository.class);
final SourceIdentifier sourceIdentifier = RevisionSourceIdentifier.create("testID", Optional.absent());
final Props props = NetconfNodeActor.props(mock(NetconfTopologySetup.class), remoteDeviceId,
- DEFAULT_SCHEMA_REPOSITORY, schemaRepository, TIMEOUT);
+ DEFAULT_SCHEMA_REPOSITORY, schemaRepository, TIMEOUT, mountPointService);
final ActorRef actorRefSchemaRepo = TestActorRef.create(system, props, "master_mocked_schema_repository");
final ActorContext actorContext = mock(ActorContext.class);