ActionStopTempTarget extends Action { @Override public void doAction(Callback callback) { tempTarget = new TempTarget().date(DateUtil.now()).duration(0).reason(reason).source(Source.USER).low(0).high(0); TreatmentsPlugin.getPlugin().addToHistoryTempTarget(tempTarget); if (callback != null) callback.result(new PumpEnactResult().success(true).comment(R.string.ok)).run(); } ActionStopTempTarget(); @Override int friendlyName(); @Override String shortDescription(); @Override void doAction(Callback callback); @Override boolean hasDialog(); @Override String toJSON(); @Override Action fromJSON(String data); @Override Optional<Integer> icon();  }
@Test public void doActionTest() { actionStopTempTarget.doAction(new Callback() { @Override public void run() { } }); Assert.assertNotEquals(null, tempTargetAdded); }