Search in sources :

Example 1 with EntityOwnershipCandidateRegistration

use of org.opendaylight.controller.md.sal.common.api.clustering.EntityOwnershipCandidateRegistration in project controller by opendaylight.

the class LegacyEntityOwnershipServiceAdapterTest method testRegisterCandidate.

@Test
public void testRegisterCandidate() throws Exception {
    DOMEntityOwnershipCandidateRegistration mockDOMReg = mock(DOMEntityOwnershipCandidateRegistration.class);
    doNothing().when(mockDOMReg).close();
    doReturn(mockDOMReg).when(mockDOMService).registerCandidate(DOM_ENTITY);
    EntityOwnershipCandidateRegistration reg = adapter.registerCandidate(LEGACY_ENTITY);
    assertNotNull("registerCandidate returned null", reg);
    assertEquals("getInstance", LEGACY_ENTITY, reg.getInstance());
    reg.close();
    verify(mockDOMReg).close();
}
Also used : DOMEntityOwnershipCandidateRegistration(org.opendaylight.mdsal.eos.dom.api.DOMEntityOwnershipCandidateRegistration) DOMEntityOwnershipCandidateRegistration(org.opendaylight.mdsal.eos.dom.api.DOMEntityOwnershipCandidateRegistration) EntityOwnershipCandidateRegistration(org.opendaylight.controller.md.sal.common.api.clustering.EntityOwnershipCandidateRegistration) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)1 EntityOwnershipCandidateRegistration (org.opendaylight.controller.md.sal.common.api.clustering.EntityOwnershipCandidateRegistration)1 DOMEntityOwnershipCandidateRegistration (org.opendaylight.mdsal.eos.dom.api.DOMEntityOwnershipCandidateRegistration)1