ActionLoopResume extends Action { @Override public void doAction(Callback callback) { if (LoopPlugin.getPlugin().isSuspended()) { LoopPlugin.getPlugin().suspendTo(0); ConfigBuilderPlugin.getPlugin().storeSettings("ActionLoopResume"); LoopPlugin.getPlugin().createOfflineEvent(0); RxBus.INSTANCE.send(new EventRefreshOverview("ActionLoopResume")); if (callback != null) callback.result(new PumpEnactResult().success(true).comment(R.string.ok)).run(); } else { if (callback != null) callback.result(new PumpEnactResult().success(true).comment(R.string.notsuspended)).run(); } }  @Override int friendlyName(); @Override String shortDescription(); @Override void doAction(Callback callback); @Override Optional<Integer> icon();  }
@Test public void doActionTest() { LoopPlugin.getPlugin().suspendTo(DateUtil.now() + T.hours(1).msecs()); actionLoopResume.doAction(new Callback() { @Override public void run() { } }); Assert.assertEquals(false, LoopPlugin.getPlugin().isSuspended()); actionLoopResume.doAction(new Callback() { @Override public void run() { } }); Assert.assertEquals(false, LoopPlugin.getPlugin().isSuspended()); }