SSMRaiderImpl implements SSMRaider { @Override public String executeShellCommands(List<String> instances, List<String> commands) { SendCommandRequest sendCommandRequest = new SendCommandRequest() .withInstanceIds(instances) .withComment("Cloud-Raider FMEA Execution") .withDocumentName("AWS-RunShellScript") .addParametersEntry("commands",commands); logger.info("SSMRaider execCommands: " + commands); logger.info("SSMRaider Instances " + instances ); SendCommandResult result = ssmDelegator.getAWSSimpleSystemsManagement().sendCommand(sendCommandRequest); return result.getCommand().getCommandId(); } SSMRaiderImpl(); @Override String executeShellCommands(List<String> instances, List<String> commands); @Override String getCommandStatus(String commandId, String instanceId); @Override String getCommandStandardOutput(String commandId, String instanceId); @Override String getCommandErrors(String commandId, String instanceId); @Override String executeShellCommandsFromFile(List<String> instances, String fileName, String... params); @Override String executeShellCommand(List<String> instances, Command command, String... params);  }
@Test public void testExecuteShellCommands() throws Exception{ String commandId = ssmRaiderUnderTest.executeShellCommands(createInstancesList(), createCommandsList()); Assert.assertEquals(commandId, "777"); }