ActionCreator { public final void createSetTodoItemAsEditableAction(long todoId) { DataBundle<ViewAction.DataKeys> bundle = new DataBundle<>(); bundle.put(ViewAction.DataKeys.ID, todoId); actionBus.post(new ViewAction(ViewAction.ActionTypes.MARK_EDITABLE, bundle)); } @Inject  ActionCreator(ActionBus actionBus); final void createNewTodoAction(final String newTodoDescription); final void createToggleTodoCompleteAction(long todoId); final void createToggleAllTodosCompleteAction(); final void createEditTodoAction(long todoId, String newDescription); final void createDeleteTodoAction(long todoId); final void createDeleteAllCompleteTodosAction(); final void createUndoDeleteAllCompleteTodosAction(); final void createViewAllTodosAction(); final void createViewActiveTodosAction(); final void createViewCompleteTodosAction(); final void createSetTodoItemAsEditableAction(long todoId);  }
@Test public void createSetTodoItemAsEditableActionTest() { final AtomicBoolean testDone = new AtomicBoolean(false); actionBus.register(new Object() { @Subscribe public void addTodo(ViewAction action) { assertThat(action.getData().get(ViewAction.DataKeys.ID, -1)).isEqualTo(10); testDone.set(true); } }); actionCreator.createSetTodoItemAsEditableAction(10); while (!testDone.get()) ; }