DataflowExecutionContext { public ExecutionStateTracker getExecutionStateTracker() { return executionStateTracker; } DataflowExecutionContext(
      CounterFactory counterFactory,
      MetricsContainerRegistry<?> metricsRegistry,
      DataflowExecutionStateTracker executionStateTracker,
      DataflowExecutionStateRegistry executionStateRegistry,
      long sinkByteLimit); SideInputReader getSideInputReader(
      @Nullable Iterable<? extends SideInputInfo> sideInputInfos,
      @Nullable Iterable<? extends PCollectionView<?>> views,
      DataflowOperationContext operationContext); CounterFactory getCounterFactory(); Collection<? extends T> getAllStepContexts(); T getStepContext(DataflowOperationContext operationContext); DataflowOperationContext createOperationContext(NameContext nameContext); ExecutionStateTracker getExecutionStateTracker();  }
@Test public void testContextActivationObserverActivation() throws Exception { BatchModeExecutionContext executionContext = BatchModeExecutionContext.forTesting(PipelineOptionsFactory.create(), "testStage"); Closeable c = executionContext.getExecutionStateTracker().activate(); c.close(); assertTrue(AutoRegistrationClass.WAS_CALLED); assertFalse(AutoRegistrationClassNotActive.WAS_CALLED); }