+
+ private static void sendDatastoreContextUpdate(DistributedDataStore dataStore, final Builder builder) {
+ DatastoreContextFactory mockContextFactory = Mockito.mock(DatastoreContextFactory.class);
+ Answer<DatastoreContext> answer = new Answer<DatastoreContext>() {
+ @Override
+ public DatastoreContext answer(InvocationOnMock invocation) {
+ return builder.build();
+ }
+ };
+ Mockito.doAnswer(answer).when(mockContextFactory).getBaseDatastoreContext();
+ Mockito.doAnswer(answer).when(mockContextFactory).getShardDatastoreContext(Mockito.anyString());
+ dataStore.onDatastoreContextUpdated(mockContextFactory);
+ }