ActionNotification extends Action { @Override public void doAction(Callback callback) { Notification notification = new Notification(Notification.USERMESSAGE, text.getValue(), Notification.URGENT); RxBus.INSTANCE.send(new EventNewNotification(notification)); NSUpload.uploadError(text.getValue()); RxBus.INSTANCE.send(new EventRefreshOverview("ActionNotification")); if (callback != null) callback.result(new PumpEnactResult().success(true).comment(R.string.ok)).run(); }  @Override int friendlyName(); @Override String shortDescription(); @Override void doAction(Callback callback); @Override Optional<Integer> icon(); @Override String toJSON(); @Override Action fromJSON(String data); @Override boolean hasDialog(); @Override void generateDialog(LinearLayout root); public InputString text; }
@Test public void doActionTest() { actionNotification.doAction(new Callback() { @Override public void run() { Assert.assertTrue(result.success); } }); }