### Question:
UpdateBrokerConfigSubCommand implements SubCommand { @Override public void execute(CommandLine commandLine, Options options, RPCHook rpcHook) throws SubCommandException { DefaultMQAdminExt defaultMQAdminExt = new DefaultMQAdminExt(rpcHook, 20 * 1000); defaultMQAdminExt.setInstanceName(Long.toString(System.currentTimeMillis())); try { int index = 0; Properties properties = new Properties(); while (true) { String optionKey = index == 0 ? "k" : ("k" + index); String optionValue = index == 0 ? "v" : ("v" + index); if (!commandLine.hasOption(optionKey)) { break; } String key = commandLine.getOptionValue(optionKey).trim(); String value = commandLine.getOptionValue(optionValue).trim(); properties.put(key, value); index++; } System.out.printf("properties:%s\n", properties.toString()); if (commandLine.hasOption('b')) { String brokerAddr = commandLine.getOptionValue('b').trim(); defaultMQAdminExt.start(); defaultMQAdminExt.updateBrokerConfig(brokerAddr, properties); System.out.printf("update broker config success, broker:%s, config:%s\n", brokerAddr, properties.toString()); return; } else if (commandLine.hasOption('c')) { String clusterName = commandLine.getOptionValue('c').trim(); defaultMQAdminExt.start(); Set<String> masterSet = CommandUtil.fetchMasterAddrByClusterName(defaultMQAdminExt, clusterName); for (String brokerAddr : masterSet) { try { defaultMQAdminExt.updateBrokerConfig(brokerAddr, properties); System.out.printf("update broker config success, broker:%s, config:%s\n", brokerAddr, properties.toString()); } catch (Exception e) { e.printStackTrace(); } } return; } ServerUtil.printCommandLineHelp("mqadmin " + this.commandName(), options); } catch (Exception e) { throw new SubCommandException(this.getClass().getSimpleName() + " command failed", e); } finally { defaultMQAdminExt.shutdown(); } }  @Override String commandName(); @Override String commandDesc(); @Override Options buildCommandlineOptions(Options options); @Override void execute(CommandLine commandLine, Options options, RPCHook rpcHook);  }### Answer:
@Ignore @Test public void testExecute() throws SubCommandException { UpdateBrokerConfigSubCommand cmd = new UpdateBrokerConfigSubCommand(); Options options = ServerUtil.buildCommandlineOptions(new Options()); String[] subargs = new String[] {"-b 127.0.0.1:10911", "-c default-cluster", "-k topicname", "-v unit_test"}; final CommandLine commandLine = ServerUtil.parseCmdLine("mqadmin " + cmd.commandName(), subargs, cmd.buildCommandlineOptions(options), new PosixParser()); cmd.execute(commandLine, options, null); }