SystemCtl { public SystemCtlDisable disable(String unit) { return new SystemCtlDisable(unit); } SystemCtl(Terminal terminal); SystemCtl withSudo(); boolean useSudo(); void daemonReload(TaskContext taskContext); SystemCtlEnable enable(String unit); SystemCtlDisable disable(String unit); SystemCtlStart start(String unit); SystemCtlStop stop(String unit); SystemCtlRestart restart(String unit); boolean serviceExists(TaskContext context, String unit); boolean isActive(TaskContext context, String unit);  }
@Test public void disable() { terminal.expectCommand("systemctl --quiet is-enabled docker 2>&1") .expectCommand("systemctl disable docker 2>&1") .expectCommand("systemctl --quiet is-enabled docker 2>&1", 1, ""); assertTrue(new SystemCtl(terminal).disable("docker").converge(taskContext)); assertFalse("Already converged", new SystemCtl(terminal).disable("docker").converge(taskContext)); }