SystemCtl { public SystemCtlStop stop(String unit) { return new SystemCtlStop(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 stop() { terminal.expectCommand( "systemctl show docker 2>&1", 0, "a=b\n" + "ActiveState=active\n" + "bar=zoo\n") .expectCommand("systemctl stop docker 2>&1", 0, ""); assertTrue(new SystemCtl(terminal).stop("docker").converge(taskContext)); }