2 * Copyright (c) 2016 Cisco Systems, Inc. and others. All rights reserved.
4 * This program and the accompanying materials are made available under the
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
8 package org.opendaylight.mdsal.singleton.dom.impl;
10 import static org.junit.Assert.assertFalse;
11 import static org.junit.Assert.assertNotNull;
12 import static org.junit.Assert.assertNull;
13 import static org.junit.Assert.assertThrows;
14 import static org.junit.Assert.assertTrue;
15 import static org.mockito.Mockito.doNothing;
16 import static org.mockito.Mockito.doReturn;
17 import static org.mockito.Mockito.never;
18 import static org.mockito.Mockito.verify;
19 import static org.opendaylight.mdsal.eos.common.api.EntityOwnershipStateChange.LOCAL_OWNERSHIP_GRANTED;
20 import static org.opendaylight.mdsal.eos.common.api.EntityOwnershipStateChange.LOCAL_OWNERSHIP_LOST_NEW_OWNER;
21 import static org.opendaylight.mdsal.eos.common.api.EntityOwnershipStateChange.LOCAL_OWNERSHIP_LOST_NO_OWNER;
22 import static org.opendaylight.mdsal.eos.common.api.EntityOwnershipStateChange.REMOTE_OWNERSHIP_CHANGED;
23 import static org.opendaylight.mdsal.eos.common.api.EntityOwnershipStateChange.REMOTE_OWNERSHIP_LOST_NO_OWNER;
24 import static org.opendaylight.mdsal.singleton.dom.impl.EOSClusterSingletonServiceProvider.CLOSE_SERVICE_ENTITY_TYPE;
25 import static org.opendaylight.mdsal.singleton.dom.impl.EOSClusterSingletonServiceProvider.SERVICE_ENTITY_TYPE;
27 import com.google.common.util.concurrent.Futures;
28 import com.google.common.util.concurrent.ListenableFuture;
29 import java.util.concurrent.ExecutionException;
30 import org.eclipse.jdt.annotation.NonNull;
31 import org.junit.Before;
32 import org.junit.Test;
33 import org.junit.runner.RunWith;
34 import org.mockito.Mock;
35 import org.mockito.junit.MockitoJUnitRunner;
36 import org.opendaylight.mdsal.eos.common.api.CandidateAlreadyRegisteredException;
37 import org.opendaylight.mdsal.eos.dom.api.DOMEntity;
38 import org.opendaylight.mdsal.eos.dom.api.DOMEntityOwnershipListener;
39 import org.opendaylight.mdsal.eos.dom.api.DOMEntityOwnershipService;
40 import org.opendaylight.mdsal.singleton.common.api.ClusterSingletonService;
41 import org.opendaylight.mdsal.singleton.common.api.ServiceGroupIdentifier;
42 import org.opendaylight.yangtools.concepts.Registration;
45 * Testing {@link ActiveServiceGroup}.
47 @RunWith(MockitoJUnitRunner.StrictStubs.class)
48 public class ActiveServiceGroupTest {
49 private static final String SERVICE_IDENTIFIER = "TestServiceIdent";
50 private static final ServiceGroupIdentifier SERVICE_GROUP_IDENT = new ServiceGroupIdentifier(SERVICE_IDENTIFIER);
52 public static final @NonNull DOMEntity MAIN_ENTITY = new DOMEntity(SERVICE_ENTITY_TYPE, SERVICE_IDENTIFIER);
53 public static final @NonNull DOMEntity CLOSE_ENTITY = new DOMEntity(CLOSE_SERVICE_ENTITY_TYPE, SERVICE_IDENTIFIER);
56 public ClusterSingletonService mockClusterSingletonService;
58 public ClusterSingletonService mockClusterSingletonServiceSecond;
60 public Registration mockEntityCandReg;
62 public Registration mockCloseEntityCandReg;
64 public DOMEntityOwnershipListener mockEosListener;
66 public DOMEntityOwnershipService mockEosService;
68 private ActiveServiceGroup singletonServiceGroup;
69 private ServiceRegistration firstReg;
70 private ServiceRegistration secondReg;
73 * Initialization functionality for every Tests in this suite.
75 * @throws CandidateAlreadyRegisteredException unexpected exception.
78 public void setup() throws CandidateAlreadyRegisteredException {
79 doReturn(mockEntityCandReg).when(mockEosService).registerCandidate(MAIN_ENTITY);
80 doReturn(mockCloseEntityCandReg).when(mockEosService).registerCandidate(CLOSE_ENTITY);
81 doNothing().when(mockEntityCandReg).close();
82 doNothing().when(mockCloseEntityCandReg).close();
83 doNothing().when(mockClusterSingletonService).instantiateServiceInstance();
84 doReturn(Futures.immediateFuture(null)).when(mockClusterSingletonService).closeServiceInstance();
86 doReturn(SERVICE_GROUP_IDENT).when(mockClusterSingletonService).getIdentifier();
87 doReturn(SERVICE_GROUP_IDENT).when(mockClusterSingletonServiceSecond).getIdentifier();
89 firstReg = new ServiceRegistration(mockClusterSingletonService) {
91 protected void removeRegistration() {
95 secondReg = new ServiceRegistration(mockClusterSingletonServiceSecond) {
97 protected void removeRegistration() {
102 singletonServiceGroup = new ActiveServiceGroup(SERVICE_IDENTIFIER, MAIN_ENTITY, CLOSE_ENTITY, mockEosService);
106 * Test NULL ServiceIdent input for new ServiceGroup instance.
109 public void instantiationClusterSingletonServiceGroupNullIdentTest() {
110 assertThrows(NullPointerException.class,
111 () -> new ActiveServiceGroup(null, MAIN_ENTITY, CLOSE_ENTITY, mockEosService));
115 * Test empty ServiceIdent input for new ServiceGroup instance.
118 public void instantiationClusterSingletonServiceGroupEmptyIdentTest() {
119 assertThrows(IllegalArgumentException.class,
120 () -> new ActiveServiceGroup("", MAIN_ENTITY, CLOSE_ENTITY, mockEosService));
124 * Test NULL MainEntity input for new ServiceGroup instance.
127 public void instantiationClusterSingletonServiceGroupNullMainEntityTest() {
128 assertThrows(NullPointerException.class,
129 () -> new ActiveServiceGroup(SERVICE_IDENTIFIER, null, CLOSE_ENTITY, mockEosService));
133 * Test NULL CloseEntity input for new ServiceGroup instance.
136 public void instantiationClusterSingletonServiceGroupNullCloseEntityTest() {
137 assertThrows(NullPointerException.class,
138 () -> new ActiveServiceGroup(SERVICE_IDENTIFIER, MAIN_ENTITY, null, mockEosService));
142 * Test NULL EntityOwnershipService input for new ServiceGroup instance.
145 public void instantiationClusterSingletonServiceGroupNullEOS_Test() {
146 assertThrows(NullPointerException.class,
147 () -> new ActiveServiceGroup(SERVICE_IDENTIFIER, MAIN_ENTITY, CLOSE_ENTITY, null));
151 * Test GoldPath for initialization ServiceGroup.
154 public void initializationClusterSingletonServiceGroupTest() throws CandidateAlreadyRegisteredException {
155 singletonServiceGroup.initialize();
156 verify(mockEosService).registerCandidate(MAIN_ENTITY);
160 * Test GoldPath for NO-TO-SLAVE entity Candidate role change.
162 * @throws CandidateAlreadyRegisteredException - unexpected exception
165 public void initializationSlaveTest() throws CandidateAlreadyRegisteredException {
166 singletonServiceGroup.initialize();
167 verify(mockEosService).registerCandidate(MAIN_ENTITY);
168 singletonServiceGroup.registerService(firstReg);
169 singletonServiceGroup.ownershipChanged(MAIN_ENTITY, LOCAL_OWNERSHIP_LOST_NEW_OWNER, false);
170 verify(mockClusterSingletonService, never()).instantiateServiceInstance();
171 verify(mockEosService, never()).registerCandidate(CLOSE_ENTITY);
175 * Test GoldPath for NO-TO-SLAVE but without MASTER entity Candidate role change.
177 * @throws CandidateAlreadyRegisteredException - unexpected exception
180 public void initializationNoMasterTest() throws CandidateAlreadyRegisteredException {
181 singletonServiceGroup.initialize();
182 verify(mockEosService).registerCandidate(MAIN_ENTITY);
183 singletonServiceGroup.registerService(firstReg);
184 singletonServiceGroup.ownershipChanged(MAIN_ENTITY, LOCAL_OWNERSHIP_LOST_NO_OWNER, false);
185 verify(mockClusterSingletonService, never()).instantiateServiceInstance();
186 verify(mockEosService, never()).registerCandidate(CLOSE_ENTITY);
190 * Test GoldPath for InJeopardy entity Candidate role change.
192 * @throws CandidateAlreadyRegisteredException - unexpected exception
195 public void initializationInJeopardyTest() throws CandidateAlreadyRegisteredException {
196 singletonServiceGroup.initialize();
197 verify(mockEosService).registerCandidate(MAIN_ENTITY);
198 singletonServiceGroup.registerService(firstReg);
199 singletonServiceGroup.ownershipChanged(MAIN_ENTITY, REMOTE_OWNERSHIP_LOST_NO_OWNER, true);
200 verify(mockClusterSingletonService, never()).instantiateServiceInstance();
201 verify(mockEosService, never()).registerCandidate(CLOSE_ENTITY);
205 * Test GoldPath for registration SingletonService.
207 * @throws CandidateAlreadyRegisteredException - unexpected exception
210 public void serviceRegistrationClusterSingletonServiceGroupTest() throws CandidateAlreadyRegisteredException {
211 singletonServiceGroup.initialize();
212 verify(mockEosService).registerCandidate(MAIN_ENTITY);
213 singletonServiceGroup.registerService(firstReg);
217 * Test GoldPath for registration SingletonService.
219 * @throws CandidateAlreadyRegisteredException - unexpected exception
222 public void serviceRegistrationClusterSingletonServiceGroupTwoServiceTest()
223 throws CandidateAlreadyRegisteredException {
224 singletonServiceGroup.initialize();
225 verify(mockEosService).registerCandidate(MAIN_ENTITY);
226 singletonServiceGroup.registerService(firstReg);
227 singletonServiceGroup.registerService(secondReg);
231 * Test GoldPath for unregistration SingletonService don't call closeServiceInstance
232 * without mastership and don't remove ServiceGroup from map.
234 * @throws CandidateAlreadyRegisteredException - unexpected exception
237 public void serviceUnregistrationClusterSingletonServiceGroupTest() throws CandidateAlreadyRegisteredException {
238 singletonServiceGroup.initialize();
239 verify(mockEosService).registerCandidate(MAIN_ENTITY);
240 singletonServiceGroup.registerService(firstReg);
241 assertNotNull(singletonServiceGroup.unregisterService(firstReg));
242 verify(mockClusterSingletonService, never()).closeServiceInstance();
246 * Test GoldPath for unregistration SingletonService don't call closeServiceInstance
247 * without mastership and don't remove ServiceGroup from map.
249 * @throws CandidateAlreadyRegisteredException - unexpected exception
252 public void serviceUnregistrationClusterSingletonServiceGroupTwoServicesTest()
253 throws CandidateAlreadyRegisteredException {
254 singletonServiceGroup.initialize();
255 verify(mockEosService).registerCandidate(MAIN_ENTITY);
256 singletonServiceGroup.registerService(firstReg);
257 singletonServiceGroup.registerService(secondReg);
258 assertNull(singletonServiceGroup.unregisterService(firstReg));
259 verify(mockClusterSingletonService, never()).closeServiceInstance();
263 * Test GoldPath get Slave role for registered main entity.
265 * @throws CandidateAlreadyRegisteredException - unexpected exception
268 public void getSlaveClusterSingletonServiceGroupTest() throws CandidateAlreadyRegisteredException {
269 singletonServiceGroup.initialize();
270 verify(mockEosService).registerCandidate(MAIN_ENTITY);
271 singletonServiceGroup.registerService(firstReg);
272 singletonServiceGroup.ownershipChanged(MAIN_ENTITY, LOCAL_OWNERSHIP_LOST_NEW_OWNER, false);
273 verify(mockClusterSingletonService, never()).instantiateServiceInstance();
277 * Test GoldPath get Master role for registered main entity.
279 * @throws CandidateAlreadyRegisteredException - unexpected exception
282 public void tryToTakeLeaderClusterSingletonServiceGroupTest() throws CandidateAlreadyRegisteredException {
283 singletonServiceGroup.initialize();
284 verify(mockEosService).registerCandidate(MAIN_ENTITY);
285 singletonServiceGroup.registerService(firstReg);
286 singletonServiceGroup.ownershipChanged(MAIN_ENTITY, LOCAL_OWNERSHIP_GRANTED, false);
287 verify(mockClusterSingletonService, never()).instantiateServiceInstance();
288 verify(mockEosService).registerCandidate(CLOSE_ENTITY);
292 * Test GoldPath get Master role for registered close entity.
294 * @throws CandidateAlreadyRegisteredException - unexpected exception
297 public void takeMasterClusterSingletonServiceGroupTest() throws CandidateAlreadyRegisteredException {
298 singletonServiceGroup.initialize();
299 verify(mockEosService).registerCandidate(MAIN_ENTITY);
300 singletonServiceGroup.registerService(firstReg);
301 singletonServiceGroup.ownershipChanged(MAIN_ENTITY, LOCAL_OWNERSHIP_GRANTED, false);
302 verify(mockClusterSingletonService, never()).instantiateServiceInstance();
303 verify(mockEosService).registerCandidate(CLOSE_ENTITY);
304 singletonServiceGroup.ownershipChanged(CLOSE_ENTITY, LOCAL_OWNERSHIP_GRANTED, false);
305 verify(mockClusterSingletonService).instantiateServiceInstance();
309 * Test GoldPath get Master role for registered entity but initial Slave
310 * role for closeEntity.
312 * @throws CandidateAlreadyRegisteredException - unexpected exception
315 public void waitToTakeMasterClusterSingletonServiceGroupTest() throws CandidateAlreadyRegisteredException {
316 singletonServiceGroup.initialize();
317 verify(mockEosService).registerCandidate(MAIN_ENTITY);
318 singletonServiceGroup.registerService(firstReg);
319 singletonServiceGroup.ownershipChanged(MAIN_ENTITY, LOCAL_OWNERSHIP_GRANTED, false);
320 verify(mockClusterSingletonService, never()).instantiateServiceInstance();
321 verify(mockEosService).registerCandidate(CLOSE_ENTITY);
322 singletonServiceGroup.ownershipChanged(CLOSE_ENTITY, REMOTE_OWNERSHIP_CHANGED, false);
323 verify(mockClusterSingletonService, never()).instantiateServiceInstance();
324 verify(mockClusterSingletonService, never()).closeServiceInstance();
328 * Test inJeopardy validation during wait phase for Master role for closeEntity.
330 * @throws CandidateAlreadyRegisteredException - unexpected exception
333 public void inJeopardyInWaitPhaseClusterSingletonServiceGroupTest() throws CandidateAlreadyRegisteredException {
334 singletonServiceGroup.initialize();
335 verify(mockEosService).registerCandidate(MAIN_ENTITY);
336 singletonServiceGroup.registerService(firstReg);
337 singletonServiceGroup.ownershipChanged(MAIN_ENTITY, LOCAL_OWNERSHIP_GRANTED, false);
338 verify(mockClusterSingletonService, never()).instantiateServiceInstance();
339 verify(mockEosService).registerCandidate(CLOSE_ENTITY);
340 singletonServiceGroup.ownershipChanged(MAIN_ENTITY, REMOTE_OWNERSHIP_LOST_NO_OWNER, true);
341 verify(mockClusterSingletonService, never()).instantiateServiceInstance();
342 verify(mockClusterSingletonService, never()).closeServiceInstance();
346 * Test inJeopardy validation during wait phase for Master role for closeEntity.
348 * @throws CandidateAlreadyRegisteredException - unexpected exception
351 public void inJeopardyInWaitPhaseClusterSingletonServiceGroupTwoServiceTest()
352 throws CandidateAlreadyRegisteredException {
353 singletonServiceGroup.initialize();
354 verify(mockEosService).registerCandidate(MAIN_ENTITY);
355 singletonServiceGroup.registerService(firstReg);
356 singletonServiceGroup.registerService(secondReg);
357 singletonServiceGroup.ownershipChanged(MAIN_ENTITY, LOCAL_OWNERSHIP_GRANTED, false);
358 verify(mockClusterSingletonService, never()).instantiateServiceInstance();
359 verify(mockEosService).registerCandidate(CLOSE_ENTITY);
360 singletonServiceGroup.ownershipChanged(MAIN_ENTITY, REMOTE_OWNERSHIP_LOST_NO_OWNER, true);
361 verify(mockClusterSingletonService, never()).instantiateServiceInstance();
362 verify(mockClusterSingletonService, never()).closeServiceInstance();
366 * Test inJeopardy validation for holding leadership.
368 * @throws CandidateAlreadyRegisteredException - unexpected exception
371 public void inJeopardyLeaderClusterSingletonServiceGroupTest() throws CandidateAlreadyRegisteredException {
372 singletonServiceGroup.initialize();
373 verify(mockEosService).registerCandidate(MAIN_ENTITY);
374 singletonServiceGroup.registerService(firstReg);
375 singletonServiceGroup.ownershipChanged(MAIN_ENTITY, LOCAL_OWNERSHIP_GRANTED, false);
376 verify(mockClusterSingletonService, never()).instantiateServiceInstance();
377 verify(mockEosService).registerCandidate(CLOSE_ENTITY);
378 singletonServiceGroup.ownershipChanged(CLOSE_ENTITY, LOCAL_OWNERSHIP_GRANTED, false);
379 verify(mockClusterSingletonService).instantiateServiceInstance();
381 // Base entity in jeopardy should not matter...
382 singletonServiceGroup.ownershipChanged(MAIN_ENTITY, LOCAL_OWNERSHIP_GRANTED, true);
383 verify(mockClusterSingletonService, never()).closeServiceInstance();
385 // ... application state is actually guarded by cleanup
386 singletonServiceGroup.ownershipChanged(CLOSE_ENTITY, REMOTE_OWNERSHIP_LOST_NO_OWNER, true);
387 verify(mockClusterSingletonService).closeServiceInstance();
391 * Test GoldPath for SLAVE-TO-MASTER entity Candidate role change.
393 * @throws CandidateAlreadyRegisteredException - unexpected exception
396 public void lostLeaderClusterSingletonServiceGroupTest() throws CandidateAlreadyRegisteredException {
397 singletonServiceGroup.initialize();
398 verify(mockEosService).registerCandidate(MAIN_ENTITY);
399 singletonServiceGroup.registerService(firstReg);
400 singletonServiceGroup.ownershipChanged(MAIN_ENTITY, LOCAL_OWNERSHIP_GRANTED, false);
401 verify(mockClusterSingletonService, never()).instantiateServiceInstance();
402 verify(mockEosService).registerCandidate(CLOSE_ENTITY);
403 singletonServiceGroup.ownershipChanged(CLOSE_ENTITY, LOCAL_OWNERSHIP_GRANTED, false);
404 verify(mockClusterSingletonService).instantiateServiceInstance();
405 singletonServiceGroup.ownershipChanged(MAIN_ENTITY, LOCAL_OWNERSHIP_LOST_NEW_OWNER, false);
406 verify(mockClusterSingletonService).closeServiceInstance();
410 * Test checks validation Error processing for SLAVE-TO-MASTER entity Candidate role change.
411 * Not initialized provider has to close and remove all singletonServices from Group and
412 * Group itself remove too.
414 @Test(expected = IllegalStateException.class)
415 public void tryToTakeLeaderForNotInitializedGroupTest() {
416 singletonServiceGroup.registerService(firstReg);
420 * Test checks closing processing for close {@link ServiceRegistration}.
422 * @throws CandidateAlreadyRegisteredException - unexpected exception
425 public void checkClosingRegistrationTest() throws CandidateAlreadyRegisteredException {
426 singletonServiceGroup.initialize();
427 verify(mockEosService).registerCandidate(MAIN_ENTITY);
428 singletonServiceGroup.registerService(firstReg);
429 singletonServiceGroup.ownershipChanged(MAIN_ENTITY, LOCAL_OWNERSHIP_GRANTED, false);
430 verify(mockClusterSingletonService, never()).instantiateServiceInstance();
431 verify(mockEosService).registerCandidate(CLOSE_ENTITY);
432 singletonServiceGroup.ownershipChanged(CLOSE_ENTITY, LOCAL_OWNERSHIP_GRANTED, false);
433 verify(mockClusterSingletonService).instantiateServiceInstance();
434 assertNotNull(singletonServiceGroup.unregisterService(firstReg));
435 verify(mockClusterSingletonService, never()).closeServiceInstance();
436 singletonServiceGroup.ownershipChanged(MAIN_ENTITY, LOCAL_OWNERSHIP_LOST_NO_OWNER, false);
437 verify(mockClusterSingletonService).closeServiceInstance();
441 * Test checks validation Error processing for MASTER-TO-SLAVE closeEntity Candidate role change.
443 * @throws CandidateAlreadyRegisteredException - unexpected exception
446 public void checkClosingUnexpectedDoubleEntityForMasterOwnershipChangeRegistrationTest()
447 throws CandidateAlreadyRegisteredException {
448 singletonServiceGroup.initialize();
449 verify(mockEosService).registerCandidate(MAIN_ENTITY);
450 singletonServiceGroup.registerService(firstReg);
451 singletonServiceGroup.ownershipChanged(MAIN_ENTITY, LOCAL_OWNERSHIP_GRANTED, false);
452 verify(mockClusterSingletonService, never()).instantiateServiceInstance();
453 verify(mockEosService).registerCandidate(CLOSE_ENTITY);
454 singletonServiceGroup.ownershipChanged(CLOSE_ENTITY, LOCAL_OWNERSHIP_GRANTED, false);
455 verify(mockClusterSingletonService).instantiateServiceInstance();
456 singletonServiceGroup.ownershipChanged(CLOSE_ENTITY, LOCAL_OWNERSHIP_LOST_NEW_OWNER, false);
457 verify(mockClusterSingletonService).closeServiceInstance();
461 * Test checks validation Error processing for MASTER-TO-SLAVE closeEntity Candidate role change
462 * without closeEntity registration.
464 * @throws CandidateAlreadyRegisteredException - unexpected exception
467 public void checkClosingUnexpectedDoubleEntityForSlaveOwnershipChangeRegistrationTest()
468 throws CandidateAlreadyRegisteredException {
469 singletonServiceGroup.initialize();
470 verify(mockEosService).registerCandidate(MAIN_ENTITY);
471 singletonServiceGroup.registerService(firstReg);
472 singletonServiceGroup.ownershipChanged(MAIN_ENTITY, LOCAL_OWNERSHIP_LOST_NEW_OWNER, false);
473 verify(mockClusterSingletonService, never()).instantiateServiceInstance();
474 verify(mockEosService, never()).registerCandidate(CLOSE_ENTITY);
475 singletonServiceGroup.ownershipChanged(CLOSE_ENTITY, LOCAL_OWNERSHIP_LOST_NEW_OWNER, false);
476 verify(mockClusterSingletonService, never()).closeServiceInstance();
480 public void testRegisterCloseShutdown() throws CandidateAlreadyRegisteredException, InterruptedException,
482 initializeGroupAndStartService();
484 assertNotNull(singletonServiceGroup.unregisterService(firstReg));
485 verify(mockClusterSingletonService, never()).closeServiceInstance();
486 verify(mockEntityCandReg).close();
488 final ListenableFuture<?> future = singletonServiceGroup.closeClusterSingletonGroup();
489 assertNotNull(future);
490 assertFalse(future.isDone());
491 verify(mockClusterSingletonService).closeServiceInstance();
493 singletonServiceGroup.ownershipChanged(MAIN_ENTITY, LOCAL_OWNERSHIP_LOST_NEW_OWNER, false);
494 verify(mockCloseEntityCandReg).close();
496 singletonServiceGroup.ownershipChanged(CLOSE_ENTITY, LOCAL_OWNERSHIP_LOST_NEW_OWNER, false);
497 assertTrue(future.isDone());
498 assertNull(future.get());
501 private void initialize() throws CandidateAlreadyRegisteredException {
502 singletonServiceGroup.initialize();
503 verify(mockEosService).registerCandidate(MAIN_ENTITY);
506 private void initializeGroupAndStartService() throws CandidateAlreadyRegisteredException {
508 singletonServiceGroup.registerService(firstReg);
509 singletonServiceGroup.ownershipChanged(MAIN_ENTITY, LOCAL_OWNERSHIP_GRANTED, false);
510 verify(mockEosService).registerCandidate(CLOSE_ENTITY);
511 singletonServiceGroup.ownershipChanged(CLOSE_ENTITY, LOCAL_OWNERSHIP_GRANTED, false);
512 verify(mockClusterSingletonService).instantiateServiceInstance();