@Test
public void noApiServerAndFailingLocalStoreDoesNotCrashTheFeatureLoader() {

  ServerConfiguration serverConfiguration =
      new ServerConfiguration()
          .baseURI("http://localhost")
          .defaultGroup("the_group");
  final FeatureClient client = FeatureClient.newBuilder()
      // set useless store and backing
      .featureStore(new FeatureStoreFailing())
      .localFeatureStore(new FeatureStoreLocalNone())
      .serverConfiguration(serverConfiguration)
      .build();
  FeatureStoreLocal failing = new FeatureStoreLocalFailing();
  FeatureStoreReal fs = new FeatureStoreReal(client, failing);
  try {
    fs.open();
    assertTrue("should call api server for single group",
        fs.loadFromApiAttempted.get());
    assertFalse("should call api server for single group when api server down",
        fs.loadFromApiSuccessful.get());
    assertTrue(
        "should call local store for single group",
        fs.loadFromLocalAttempted.get());
    assertFalse("should not load local store for single group when local store crashes",
        fs.loadFromLocalSuccessful.get());
  } catch (Exception e) {
    e.printStackTrace();
    fail();
  }
}