@Test(dataProvider = "app", retryAnalyzer = InternalServerErrorAnalyzer.class)
public void testRunCommand(App app) throws IOException {
Run run = new Run(app.getName(), "echo helloworld");
Run runAttached = new Run(app.getName(), "echo helloworld", true);
RunResponse response = connection.execute(run, apiKey);
try {
response.attach();
fail("Should throw an illegal state exception");
} catch (IllegalStateException ex) {
//ok
}
RunResponse responseAttach = connection.execute(runAttached, apiKey);
String output = HttpUtil.getUTF8String(HttpUtil.getBytes(responseAttach.attach()));
System.out.println("RUN OUTPUT:" + output);
assertTrue(output.contains("helloworld"));
}