@Test public void testDeleteFlowHandling() throws Exception { Class<DeleteFlowLang> class1 = DeleteFlowLang.class; Field field = class1.getDeclaredField("deleteFlow"); field.setAccessible(true); UserId userId = mock(UserId.class); String flowname = new String("test"); DeleteFlow deleteFlow = mock(DeleteFlow.class); when(tenantManage.getObjectId(userId,flowname)) .thenReturn(null) .thenReturn("00001111-0000-0000-0000-000011112222"); Assert.assertTrue(deleteFlowLang.DeleteFlowHandling(userId, flowname).equals("The flow " + flowname + " is not exist.")); field.set(deleteFlowLang, deleteFlow); when(deleteFlow.DeleteFlowHandling(any(UserId.class),any(FlowId.class))).thenReturn(new String("test")); Assert.assertTrue(deleteFlowLang.DeleteFlowHandling(userId, flowname).equals("test")); }
public String DeleteFlowHandling(UserId userId, String flowname){ if (tenantManage.getObjectId(userId,flowname)!=null){ FlowId flowId = new FlowId(tenantManage.getObjectId(userId,flowname)); return deleteFlow.DeleteFlowHandling(userId,flowId); } else { return "The flow " + flowname + " is not exist."; } }
DeleteFlowLang { public String DeleteFlowHandling(UserId userId, String flowname){ if (tenantManage.getObjectId(userId,flowname)!=null){ FlowId flowId = new FlowId(tenantManage.getObjectId(userId,flowname)); return deleteFlow.DeleteFlowHandling(userId,flowId); } else { return "The flow " + flowname + " is not exist."; } } }
DeleteFlowLang { public String DeleteFlowHandling(UserId userId, String flowname){ if (tenantManage.getObjectId(userId,flowname)!=null){ FlowId flowId = new FlowId(tenantManage.getObjectId(userId,flowname)); return deleteFlow.DeleteFlowHandling(userId,flowId); } else { return "The flow " + flowname + " is not exist."; } } DeleteFlowLang(DataBroker dataBroker, TenantManage tenantManage); }
DeleteFlowLang { public String DeleteFlowHandling(UserId userId, String flowname){ if (tenantManage.getObjectId(userId,flowname)!=null){ FlowId flowId = new FlowId(tenantManage.getObjectId(userId,flowname)); return deleteFlow.DeleteFlowHandling(userId,flowId); } else { return "The flow " + flowname + " is not exist."; } } DeleteFlowLang(DataBroker dataBroker, TenantManage tenantManage); String DeleteFlowHandling(UserId userId, String flowname); }
DeleteFlowLang { public String DeleteFlowHandling(UserId userId, String flowname){ if (tenantManage.getObjectId(userId,flowname)!=null){ FlowId flowId = new FlowId(tenantManage.getObjectId(userId,flowname)); return deleteFlow.DeleteFlowHandling(userId,flowId); } else { return "The flow " + flowname + " is not exist."; } } DeleteFlowLang(DataBroker dataBroker, TenantManage tenantManage); String DeleteFlowHandling(UserId userId, String flowname);  }