public void testSubmitEntityValidCommands() throws Exception {
FalconCLI.OUT.set(stream);
String filePath;
TestContext context = new TestContext();
Map<String, String> overlay = context.getUniqueOverlay();
filePath = context.overlayParametersOverTemplate(TestContext.CLUSTER_TEMPLATE, overlay);
Assert.assertEquals(
0,
executeWithURL("entity -submit -type cluster -file " + filePath));
context.setCluster(filePath);
Assert.assertEquals(stream.buffer.toString().trim(),
"default/Submit successful (cluster) " + context.getClusterName());
filePath = context.overlayParametersOverTemplate(TestContext.FEED_TEMPLATE1, overlay);
Assert.assertEquals(0,
executeWithURL("entity -submit -type feed -file " + filePath));
Assert.assertEquals(
stream.buffer.toString().trim(),
"default/Submit successful (feed) "
+ overlay.get("inputFeedName"));
filePath = context.overlayParametersOverTemplate(TestContext.FEED_TEMPLATE2, overlay);
Assert.assertEquals(0,
executeWithURL("entity -submit -type feed -file " + filePath));
Assert.assertEquals(
stream.buffer.toString().trim(),
"default/Submit successful (feed) "
+ overlay.get("outputFeedName"));
filePath = context.overlayParametersOverTemplate(TestContext.PROCESS_TEMPLATE, overlay);
Assert.assertEquals(
0,
executeWithURL("entity -submit -type process -file " + filePath));
Assert.assertEquals(
stream.buffer.toString().trim(),