OperationHistoryManager { public String recordStart(ClusterManagementOperation<?> op, String locator) { expireHistory(); return operationStateStore.recordStart(op, locator); } OperationHistoryManager(
      OperationStateStore operationStateStore, InternalCache cache);  OperationHistoryManager(Duration keepCompleted,
      OperationStateStore operationStateStore,
      InternalCache cache); @SuppressWarnings("unchecked") OperationState<A, V> get(
      String opId); String recordStart(ClusterManagementOperation<?> op, String locator); void recordEnd(String opId, OperationResult result, Throwable cause); List<OperationState<A, V>> list(
      A opType);  }
@Test public void recordStartReturnsExpectedOpId() { ClusterManagementOperation<?> op = mock(ClusterManagementOperation.class); String expectedOpId = "12345"; String locator = "locator"; when(operationStateStore.recordStart(same(op), same(locator))).thenReturn(expectedOpId); String opId = history.recordStart(op, locator); assertThat(opId).isSameAs(expectedOpId); }
@Test public void recordStartDelegatesToPersistenceService() { ClusterManagementOperation<?> op = mock(ClusterManagementOperation.class); String locator = "locator"; history.recordStart(op, locator); verify(operationStateStore).recordStart(same(op), same(locator)); }