@Test
  public void resolveStoreInitialStateTest() throws Exception {
    store.shutdown();
    properties.setProperty(StoreConfig.storeReplicaStatusDelegateEnableName, "true");
    File storeDir = createTempDirectory("store-" + storeId);
    File reserveDir = createTempDirectory("reserve-pool");
    reserveDir.deleteOnExit();
    DiskSpaceAllocator diskAllocator =
        new DiskSpaceAllocator(true, reserveDir, 0, new StorageManagerMetrics(new MetricRegistry()));
    StoreConfig config = new StoreConfig(new VerifiableProperties(properties));
    MetricRegistry registry = new MetricRegistry();
    storeMetrics = new StoreMetrics(registry);
    ClusterParticipant dynamicParticipant = mock(ClusterParticipant.class);
    when(dynamicParticipant.supportsStateChanges()).thenReturn(true);
    ReplicaStatusDelegate delegate = new ReplicaStatusDelegate(dynamicParticipant);
    BlobStore testStore =
        new BlobStore(getMockReplicaId(storeDir.getAbsolutePath()), config, scheduler, storeStatsScheduler, null,
            diskIOScheduler, diskAllocator, storeMetrics, storeMetrics, STORE_KEY_FACTORY, recovery, hardDelete,
            Collections.singletonList(delegate), time, new InMemAccountService(false, false), null, scheduler);
    testStore.start();
    assertEquals("Store current state should be OFFLINE if dynamic participant is adopted", OFFLINE,
        testStore.getCurrentState());
    testStore.shutdown();
  }
Test that if {@link HelixParticipant} is adopted, store state is set to OFFLINE after startup (which will be updated
by Helix state transition later)
@throws Exception
ambry-store/src/test/java/com/github/ambry/store/BlobStoreTest.java