@Test public void setNewState() { State state = (oldState) -> { }; ShadowLooper shadowLooper = Shadows.shadowOf(dispatchProcessor.getMainThreadHandler().getLooper()); dispatchProcessor.setNewState(state); shadowLooper.runOneTask(); Mockito.verify(stateUpdateCallback, Mockito.times(1)).notifyStateUpdate(state); }
@WorkerThread public void setNewState(@NonNull S state) { getMainThreadHandler().obtainMessage(MESSAGE_CODE_NEW_STATE, state).sendToTarget(); }
DispatchProcessor { @WorkerThread public void setNewState(@NonNull S state) { getMainThreadHandler().obtainMessage(MESSAGE_CODE_NEW_STATE, state).sendToTarget(); } }
DispatchProcessor { @WorkerThread public void setNewState(@NonNull S state) { getMainThreadHandler().obtainMessage(MESSAGE_CODE_NEW_STATE, state).sendToTarget(); } DispatchProcessor(@NonNull Store<S, A> store, @NonNull DispatchManager<S, A> dispatchManager, @NonNull ReduxStore.StateUpdateCallback<S> stateUpdateCallback, @NonNull HandlerProvider handlerProvider); }
DispatchProcessor { @WorkerThread public void setNewState(@NonNull S state) { getMainThreadHandler().obtainMessage(MESSAGE_CODE_NEW_STATE, state).sendToTarget(); } DispatchProcessor(@NonNull Store<S, A> store, @NonNull DispatchManager<S, A> dispatchManager, @NonNull ReduxStore.StateUpdateCallback<S> stateUpdateCallback, @NonNull HandlerProvider handlerProvider); @MainThread void dispatch(@NonNull A action); @WorkerThread void setNewState(@NonNull S state); @SuppressWarnings("unused") void destroy(); }
DispatchProcessor { @WorkerThread public void setNewState(@NonNull S state) { getMainThreadHandler().obtainMessage(MESSAGE_CODE_NEW_STATE, state).sendToTarget(); } DispatchProcessor(@NonNull Store<S, A> store, @NonNull DispatchManager<S, A> dispatchManager, @NonNull ReduxStore.StateUpdateCallback<S> stateUpdateCallback, @NonNull HandlerProvider handlerProvider); @MainThread void dispatch(@NonNull A action); @WorkerThread void setNewState(@NonNull S state); @SuppressWarnings("unused") void destroy();  }