import org.opendaylight.controller.cluster.databroker.actors.dds.ClientTransaction;
import org.opendaylight.controller.cluster.databroker.actors.dds.DataStoreClient;
import org.opendaylight.controller.cluster.datastore.DatastoreContext;
-import org.opendaylight.controller.cluster.datastore.utils.ActorContext;
+import org.opendaylight.controller.cluster.datastore.utils.ActorUtils;
import org.opendaylight.controller.md.cluster.datastore.model.TestModel;
import org.opendaylight.mdsal.dom.spi.store.DOMStoreReadTransaction;
import org.opendaylight.mdsal.dom.spi.store.DOMStoreReadWriteTransaction;
private DataStoreClient clientActor;
@Mock
- private ActorContext actorContext;
+ private ActorUtils actorUtils;
@Mock
private ClientLocalHistory clientLocalHistory;
public void setUp() {
MockitoAnnotations.initMocks(this);
- when(actorContext.getSchemaContext()).thenReturn(SCHEMA_CONTEXT);
- when(actorContext.getDatastoreContext()).thenReturn(DatastoreContext.newBuilder().build());
+ when(actorUtils.getSchemaContext()).thenReturn(SCHEMA_CONTEXT);
+ when(actorUtils.getDatastoreContext()).thenReturn(DatastoreContext.newBuilder().build());
when(clientTransaction.getIdentifier()).thenReturn(TRANSACTION_IDENTIFIER);
when(clientSnapshot.getIdentifier()).thenReturn(TRANSACTION_IDENTIFIER);
@Test
public void testCreateTransactionChain() {
try (ClientBackedDataStore clientBackedDataStore = new ClientBackedDataStore(
- actorContext, UNKNOWN_ID, clientActor)) {
+ actorUtils, UNKNOWN_ID, clientActor)) {
final DOMStoreTransactionChain txChain = clientBackedDataStore.createTransactionChain();
assertNotNull(txChain);
verify(clientActor, Mockito.times(1)).createLocalHistory();
@Test
public void testNewReadOnlyTransaction() {
try (ClientBackedDataStore clientBackedDataStore = new ClientBackedDataStore(
- actorContext, UNKNOWN_ID, clientActor)) {
+ actorUtils, UNKNOWN_ID, clientActor)) {
final DOMStoreReadTransaction tx = clientBackedDataStore.newReadOnlyTransaction();
assertNotNull(tx);
verify(clientActor, Mockito.times(1)).createSnapshot();
@Test
public void testNewWriteOnlyTransaction() {
try (ClientBackedDataStore clientBackedDataStore = new ClientBackedDataStore(
- actorContext, UNKNOWN_ID, clientActor)) {
+ actorUtils, UNKNOWN_ID, clientActor)) {
final DOMStoreWriteTransaction tx = clientBackedDataStore.newWriteOnlyTransaction();
assertNotNull(tx);
verify(clientActor, Mockito.times(1)).createTransaction();
@Test
public void testNewReadWriteTransaction() {
try (ClientBackedDataStore clientBackedDataStore = new ClientBackedDataStore(
- actorContext, UNKNOWN_ID, clientActor)) {
+ actorUtils, UNKNOWN_ID, clientActor)) {
final DOMStoreReadWriteTransaction tx = clientBackedDataStore.newReadWriteTransaction();
assertNotNull(tx);
verify(clientActor, Mockito.times(1)).createTransaction();