use of org.opendaylight.mdsal.dom.api.DOMDataTreeCommitCohort in project controller by opendaylight.
the class LegacyDOMDataBrokerAdapterTest method testDataTreeCommitCohortRegistry.
@SuppressWarnings("unchecked")
@Test
public void testDataTreeCommitCohortRegistry() {
DOMDataTreeCommitCohortRegistry domCohortRegistry = (DOMDataTreeCommitCohortRegistry) adapter.getSupportedExtensions().get(DOMDataTreeCommitCohortRegistry.class);
assertNotNull("DOMDataTreeCommitCohortRegistry not found", domCohortRegistry);
DOMDataTreeCommitCohort mockCohort = mock(DOMDataTreeCommitCohort.class);
org.opendaylight.mdsal.dom.api.DOMDataTreeIdentifier treeId = new org.opendaylight.mdsal.dom.api.DOMDataTreeIdentifier(org.opendaylight.mdsal.common.api.LogicalDatastoreType.CONFIGURATION, TestModel.TEST_PATH);
DOMDataTreeCommitCohortRegistration<DOMDataTreeCommitCohort> mockReg = mock(DOMDataTreeCommitCohortRegistration.class);
doReturn(mockReg).when(mockConfigStore).registerCommitCohort(treeId, mockCohort);
DOMDataTreeCommitCohortRegistration<DOMDataTreeCommitCohort> reg = domCohortRegistry.registerCommitCohort(treeId, mockCohort);
assertEquals("DOMDataTreeCommitCohortRegistration", mockReg, reg);
verify(mockConfigStore).registerCommitCohort(treeId, mockCohort);
}
Aggregations