@Test(expected = BucketNotFoundException.class)
  public void getMissingBucketByRegion() throws BucketNotFoundException {
    setUpMockBucket(0);
    when(indexForPR.isIndexAvailable(0)).thenReturn(true);

    int[] buckets = new int[] {2, 0, 1};

    InternalRegionFunctionContext ctx = Mockito.mock(InternalRegionFunctionContext.class);
    when(ctx.getLocalBucketArray((any()))).thenReturn(buckets);
    repoManager.getRepositories(ctx);
  }
Test that we get the expected exception when a user bucket is missing
geode-lucene/src/test/java/org/apache/geode/cache/lucene/internal/PartitionedRepositoryManagerJUnitTest.java