@Test
@SneakyThrows
public void shouldSelectOnlyStoresThatWhitelisted() {

  Store store1 =
      DataGenerator.createStore(
          "normal-store",
          Store.StoreType.REDIS,
          ImmutableList.of(Triple.of("project1", "*", false)));
  Store store2 =
      DataGenerator.createStore(
          "blacklisted-store",
          Store.StoreType.REDIS,
          ImmutableList.of(Triple.of("project2", "*", false)));
  Source source1 = DataGenerator.createSource("source-1", "topic");
  Source source2 = DataGenerator.createSource("source-2", "topic");
  FeatureSet featureSet1 = DataGenerator.createFeatureSet(source1, "default", "fs1");
  FeatureSet featureSet2 = DataGenerator.createFeatureSet(source2, "project", "fs3");
  when(specService.listStores(any()))
      .thenReturn(ListStoresResponse.newBuilder().addStore(store1).addStore(store2).build());
  when(specService.listFeatureSets(
          CoreServiceProto.ListFeatureSetsRequest.newBuilder()
              .setFilter(
                  Filter.newBuilder().setProject("project1").setFeatureSetName("*").build())
              .build()))
      .thenReturn(ListFeatureSetsResponse.newBuilder().addFeatureSets(featureSet1).build());
  when(specService.listFeatureSets(
          CoreServiceProto.ListFeatureSetsRequest.newBuilder()
              .setFilter(
                  Filter.newBuilder().setProject("project2").setFeatureSetName("*").build())
              .build()))
      .thenReturn(ListFeatureSetsResponse.newBuilder().addFeatureSets(featureSet2).build());
  ArrayList<Pair<Source, Set<Store>>> pairs =
      Lists.newArrayList(controllerWithConsolidation.getSourceToStoreMappings());
  assertThat(pairs, containsInAnyOrder(Pair.of(source1, ImmutableSet.of(store1))));
}