FlowManagerImpl extends LoggingObject implements FlowManager { protected boolean mappingIsReferencedByAFlow(Step removedStep) { String mappingName = removedStep.getMappingName(); if (mappingName == null) { return false; } for (Flow flow: getFlows()) { for (Step step : flow.getSteps().values()) { if (mappingName.equals(step.getMappingName())) { return true; } } } return false; }  void setHubConfig(HubConfig hubConfig); @Override Flow getFlow(String flowName); @Override String getFlowAsJSON(String flowName); @Override List<Flow> getFlows(); @Override List<String> getFlowNames(); @Override Flow createFlow(String flowName); @Override Flow createFlowFromJSON(String json); @Override Flow createFlowFromJSON(JsonNode json); @Override void deleteFlow(String flowName); @Override void deleteStep(Flow flow, String key); @Override void saveFlow(Flow flow); @Override boolean isFlowExisted(String flowName); @Deprecated @Override Map<String, Step> getSteps(Flow flow); @Override @Deprecated Step getStep(Flow flow, String stepNum); @Override @Deprecated void setSteps(Flow flow, Map<String, Step> stepMap);  }
@Test public void mappingIsReferencedByAFlow() { copyTestFlowIntoProject(); assertEquals(1, flowManager.getFlows().size()); assertTrue(flowManager.stepIsReferencedByAFlow("person-mapping1.json", StepDefinition.StepDefinitionType.MAPPING)); assertFalse(flowManager.stepIsReferencedByAFlow("mapping-that-doesnt-exist", StepDefinition.StepDefinitionType.MAPPING)); }