SSMRaiderImpl implements SSMRaider { @Override public String getCommandStatus(String commandId, String instanceId) { return getCommandInvocationResult(commandId, instanceId).getStatus(); } 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 testGetCommandStatus() throws Exception{ PowerMockito.when(getCommandInvocationResult.getStatus()).thenReturn("Success"); String status = ssmRaiderUnderTest.getCommandStatus("777" ,"i-1234"); Assert.assertEquals(status, "Success"); }