TestContext context = newContext();
context.scheduleProcess();
OozieTestUtils.waitForBundleStart(context, Job.Status.RUNNING);
List<BundleJob> bundles = OozieTestUtils.getBundles(context);
Assert.assertEquals(bundles.size(), 1);
ProxyOozieClient ozClient = OozieTestUtils.getOozieClient(context.getCluster().getCluster());
String coordId = ozClient.getBundleJobInfo(bundles.get(0).getId()).getCoordinators().get(0).getId();
Process process = (Process) getDefinition(context, EntityType.PROCESS, context.processName);
String feed3 = "f3" + System.currentTimeMillis();
Map<String, String> overlay = new HashMap<String, String>();
overlay.put("inputFeedName", feed3);
overlay.put("cluster", context.clusterName);
ClientResponse response = context.submitToFalcon(TestContext.FEED_TEMPLATE1, overlay, EntityType.FEED);
context.assertSuccessful(response);
Input input = new Input();
input.setFeed(feed3);
input.setName("inputData2");
input.setStart("today(20,0)");
input.setEnd("today(20,20)");
process.getInputs().getInputs().add(input);
updateEndtime(process);
Date endTime = getEndTime();
update(context, process, endTime);
//Assert that update creates new bundle and old coord is running
bundles = OozieTestUtils.getBundles(context);
Assert.assertEquals(bundles.size(), 2);
CoordinatorJob coord = ozClient.getCoordJobInfo(coordId);
Assert.assertEquals(coord.getStatus(), Status.RUNNING);
Assert.assertEquals(coord.getEndTime(), endTime);
}