@Override
    public String execute(CommandContext commandContext, String[] args) {

        int sleepMilliseconds = 0;
        if (args != null && args.length > 0) {
            if (args.length == 2 && "-t".equals(args[0]) && StringUtils.isNumber(args[1])) {
                sleepMilliseconds = Integer.parseInt(args[1]);
            } else {
                return "Invalid parameter,please input like shutdown -t 10000";
            }
        }
        long start = System.currentTimeMillis();
        if (sleepMilliseconds > 0) {
            try {
                Thread.sleep(sleepMilliseconds);
            } catch (InterruptedException e) {
                return "Failed to invoke shutdown command, cause: " + e.getMessage();
            }
        }
        StringBuilder buf = new StringBuilder();
        List<ApplicationModel> applicationModels = frameworkModel.getApplicationModels();
        for (ApplicationModel applicationModel : new ArrayList<>(applicationModels)) {
            applicationModel.destroy();
        }
        // TODO change to ApplicationDeployer.destroy() or ApplicationModel.destroy()
        //        DubboShutdownHook.getDubboShutdownHook().unregister();
        //        DubboShutdownHook.getDubboShutdownHook().doDestroy();
        long end = System.currentTimeMillis();
        buf.append("Application has shutdown successfully");
        buf.append("\r\nelapsed: ");
        buf.append(end - start);
        buf.append(" ms.");
        return buf.toString();
    }
@Test
    void testInvoke() throws RemotingException {
        String result = shutdown.execute(mockCommandContext, new String[0]);
        assertTrue(result.contains("Application has shutdown successfully"));
    }