class SSMStepDefinitions implements EC2StepFunctions {

    @When("^assertCommand execution status = \"([^\"]*)\"$")
    public void assertCommandExecutionStatus(final String expectedCommandStatus) {
        String commandId = executionStateCache.getCommandId();
        List<EC2InstanceTO> instances = executionStateCache.getSsmCommandInvocationInstances();
        if (commandId == null || commandId.isEmpty()) {
            throw new RuntimeException("Missing command-id information, unable to check status");
        }

        if (instances == null || instances.isEmpty()) {
            throw new RuntimeException("No instances are available to check command execution status");
        }

        instances.stream().forEach(
                instanceTO ->
                {
                    String actualCommandStatus = ssmRaider.getCommandStatus(commandId, instanceTO.getInstanceId());
                    org.testng.Assert.assertEquals(actualCommandStatus, expectedCommandStatus);
                }
        );

    }

    public  SSMStepDefinitions();

}