+ new JavaTestKit(getSystem()) {
+ {
+
+ new Within(duration("10 seconds")) {
+ protected void run() {
+ try {
+ final DistributedDataStore distributedDataStore =
+ new DistributedDataStore(getSystem(), "config",
+ new MockClusterWrapper(), configuration);
+
+ distributedDataStore.onGlobalContextUpdated(
+ SchemaContextHelper.full());
+
+ // Wait for a specific log message to show up
+ final boolean result =
+ new JavaTestKit.EventFilter<Boolean>(
+ Logging.Info.class
+ ) {
+ protected Boolean run() {
+ return true;
+ }
+ }.from(
+ "akka://test/user/shardmanager-config/member-1-shard-cars-1-config")
+ .message(
+ "Switching from state Candidate to Leader")
+ .occurrences(1)
+ .exec();
+
+ Thread.sleep(1000);
+
+
+ DOMStoreReadWriteTransaction transaction =
+ distributedDataStore.newReadWriteTransaction();