ShardManager extends AbstractUntypedPersistentActorWithMetering { Map<String, String> getPeerAddresses(final String shardName) { final Collection<MemberName> members = configuration.getMembersFromShardName(shardName); return getPeerAddresses(shardName, members); } ShardManager(final AbstractShardManagerCreator<?> builder); @Override void preStart(); @Override void postStop(); @Override void handleCommand(final Object message); @Override SupervisorStrategy supervisorStrategy(); @Override String persistenceId();  }
@Test public void testOnCreateShardWithLocalMemberNotInShardConfig() { LOG.info("testOnCreateShardWithLocalMemberNotInShardConfig starting"); final TestKit kit = new TestKit(getSystem()); datastoreContextBuilder.shardInitializationTimeout(1, TimeUnit.MINUTES).persistent(true); ActorRef shardManager = actorFactory .createActor(newShardMgrProps(new ConfigurationImpl(new EmptyModuleShardConfigProvider())) .withDispatcher(Dispatchers.DefaultDispatcherId())); shardManager.tell(new UpdateSchemaContext(TEST_SCHEMA_CONTEXT), ActorRef.noSender()); Shard.Builder shardBuilder = Shard.builder(); ModuleShardConfiguration config = new ModuleShardConfiguration(URI.create("foo-ns"), "foo-module", "foo", null, members("member-5", "member-6")); shardManager.tell(new CreateShard(config, shardBuilder, null), kit.getRef()); kit.expectMsgClass(Duration.ofSeconds(5), Success.class); shardManager.tell(new FindLocalShard("foo", true), kit.getRef()); kit.expectMsgClass(Duration.ofSeconds(5), LocalShardFound.class); assertEquals("peerMembers size", 0, shardBuilder.getPeerAddresses().size()); assertEquals("schemaContext", DisableElectionsRaftPolicy.class.getName(), shardBuilder .getDatastoreContext().getShardRaftConfig().getCustomRaftPolicyImplementationClass()); LOG.info("testOnCreateShardWithLocalMemberNotInShardConfig ending"); }