deploymentProperties = new HashMap<>();
cmdLineArgs = Arrays.asList("--commandLineArgValueThatMayNeedEscaping=" + "notWhatIsExpected");
request =
new AppDeploymentRequest(definition, testApplication(), deploymentProperties, cmdLineArgs);
log.info("Deploying {}, expecting it to fail...", request.getDefinition().getName());
<BUG>deploymentId = appDeployer().deploy(request);
</BUG>
timeout = deploymentTimeout();
assertThat(deploymentId, eventually(hasStatusThat(
Matchers.<AppStatus>hasProperty("state", is(failed))), timeout.maxAttempts, timeout.pause));

deploymentProperties = new HashMap<>();
cmdLineArgs = Arrays.asList("--commandLineArgValueThatMayNeedEscaping=" + "notWhatIsExpected");
request =
new AppDeploymentRequest(definition, testApplication(), deploymentProperties, cmdLineArgs);
log.info("Deploying {}, expecting it to fail...", request.getDefinition().getName());
deploymentId = record(appDeployer().deploy(request));
timeout = deploymentTimeout();
assertThat(deploymentId, eventually(hasStatusThat(
Matchers.<AppStatus>hasProperty("state", is(failed))), timeout.maxAttempts, timeout.pause));
