@Test
public void testOnUnregisterCandidateLocal() {

    testLog.info("testOnUnregisterCandidateLocal starting");
    ShardTestKit kit = new ShardTestKit(getSystem());
    TestActorRef<EntityOwnershipShard> shard = actorFactory.createTestActor(newLocalShardProps());
    ShardTestKit.waitUntilLeader(shard);
    DOMEntity entity = new DOMEntity(ENTITY_TYPE, ENTITY_ID1);
    // Register
    shard.tell(new RegisterCandidateLocal(entity), kit.getRef());
    kit.expectMsgClass(SuccessReply.class);
    verifyCommittedEntityCandidate(shard, ENTITY_TYPE, ENTITY_ID1, LOCAL_MEMBER_NAME);
    verifyOwner(shard, ENTITY_TYPE, ENTITY_ID1, LOCAL_MEMBER_NAME);
    // Unregister
    shard.tell(new UnregisterCandidateLocal(entity), kit.getRef());
    kit.expectMsgClass(SuccessReply.class);
    verifyOwner(shard, ENTITY_TYPE, ENTITY_ID1, "");
    // Register again
    shard.tell(new RegisterCandidateLocal(entity), kit.getRef());
    kit.expectMsgClass(SuccessReply.class);
    verifyCommittedEntityCandidate(shard, ENTITY_TYPE, ENTITY_ID1, LOCAL_MEMBER_NAME);
    verifyOwner(shard, ENTITY_TYPE, ENTITY_ID1, LOCAL_MEMBER_NAME);
    testLog.info("testOnUnregisterCandidateLocal ending");
}