@Test(dependsOnMethods = "testOnFeedEntityChange") public void testOnProcessEntityChange() throws Exception { Process oldProcess = processEntity; Process newProcess = EntityBuilderTestUtil.buildProcess(oldProcess.getName(), anotherCluster, null, null); EntityBuilderTestUtil.addProcessWorkflow(newProcess, GENERATE_WORKFLOW_NAME, "2.0.0"); EntityBuilderTestUtil.addInput(newProcess, inputFeeds.get(0)); try { configStore.initiateUpdate(newProcess); configStore.update(EntityType.PROCESS, newProcess); } finally { configStore.cleanupUpdateInit(); } verifyUpdatedEdges(newProcess); Assert.assertEquals(getVerticesCount(service.getGraph()), 22); // +0, no net new Assert.assertEquals( getEdgesCount(service.getGraph()), 29); // -6 = -2 outputs, -1 tag, -1 cluster, -2 pipelines }
public Process addProcessEntity( String processName, Cluster cluster, String tags, String pipelineTags, String workflowName, String version) throws Exception { Process process = EntityBuilderTestUtil.buildProcess(processName, cluster, tags, pipelineTags); EntityBuilderTestUtil.addProcessWorkflow(process, workflowName, version); for (Feed inputFeed : inputFeeds) { EntityBuilderTestUtil.addInput(process, inputFeed); } for (Feed outputFeed : outputFeeds) { EntityBuilderTestUtil.addOutput(process, outputFeed); } configStore.publish(EntityType.PROCESS, process); return process; }