+ Mockito.when(connectionContext.getDeviceInfo()).thenReturn(deviceInfo);
+ Mockito.when(deviceManager.createContext(connectionContext)).thenReturn(deviceContext);
+ Mockito.when(rpcManager.createContext(deviceContext)).thenReturn(rpcContext);
+ Mockito.when(roleManager.createContext(deviceContext)).thenReturn(roleContext);
+ Mockito.when(statisticsManager.createContext(Mockito.eq(deviceContext), Mockito.anyBoolean()))
+ .thenReturn(statisticsContext);
+ Mockito.when(deviceContext.getDeviceInfo()).thenReturn(deviceInfo);
+
+ Mockito.when(singletonServicesProvider.registerClusterSingletonService(Mockito.any()))
+ .thenReturn(clusterSingletonServiceRegistration);
+ Mockito.when(entityOwnershipService.registerListener(Mockito.any(), Mockito.any()))
+ .thenReturn(entityOwnershipListenerRegistration);
+ Mockito.when(connectionContext.getFeatures()).thenReturn(featuresReply);
+ Mockito.when(featuresReply.getAuxiliaryId()).thenReturn(AUXILIARY_ID);
+ Mockito.when(config.getDeviceDatastoreRemovalDelay())
+ .thenReturn(new NonZeroUint32Type(DEVICE_DATASTORE_REMOVAL_DELAY));
+
+ registration = manager.reconciliationFrameworkRegistration(reconciliationFrameworkEvent);
+
+ contextChainHolder = new ContextChainHolderImpl(
+ executorService,
+ singletonServicesProvider,
+ entityOwnershipService,
+ manager,
+ config);