bug #I88U0Q SQL插件当eldata字段为空时,启动失败

This commit is contained in:
everywhere.z
2023-10-17 21:51:43 +08:00
parent 1535c7f6d6
commit f76b78299c
34 changed files with 65 additions and 41 deletions

View File

@@ -18,6 +18,6 @@ public class BaseTest {
SpiFactoryCleaner.clean();
LiteflowConfigGetter.clean();
FlowInitHook.cleanHook();
FlowBus.clearStat();
}
}

View File

@@ -42,6 +42,7 @@ public class NacosWithXmlELSpringbootTest extends BaseTest {
@AfterEach
public void after() {
FlowBus.cleanCache();
FlowBus.clearStat();
}
@Test
@@ -55,17 +56,17 @@ public class NacosWithXmlELSpringbootTest extends BaseTest {
@Test
public void testNacosWithXml2() throws Exception {
String flowXml = "<?xml version=\"1.0\" encoding=\"UTF-8\"?><flow><chain name=\"chain1\">THEN(a, b, c);</chain></flow>";
String changedFlowXml = "<?xml version=\"1.0\" encoding=\"UTF-8\"?><flow><chain name=\"chain1\">THEN(a, c);</chain></flow>";
String flowXml = "<?xml version=\"1.0\" encoding=\"UTF-8\"?><flow><chain name=\"chain2\">THEN(a, b, c);</chain></flow>";
String changedFlowXml = "<?xml version=\"1.0\" encoding=\"UTF-8\"?><flow><chain name=\"chain2\">THEN(a, c);</chain></flow>";
when(nacosConfigService.getConfig(anyString(), anyString(), anyLong())).thenReturn(flowXml)
.thenReturn(changedFlowXml);
LiteflowResponse response = flowExecutor.execute2Resp("chain1", "arg");
LiteflowResponse response = flowExecutor.execute2Resp("chain2", "arg");
Assertions.assertEquals("a==>b==>c", response.getExecuteStepStrWithoutTime());
FlowBus.refreshFlowMetaData(FlowParserTypeEnum.TYPE_EL_XML, changedFlowXml);
response = flowExecutor.execute2Resp("chain1", "arg");
response = flowExecutor.execute2Resp("chain2", "arg");
Assertions.assertEquals("a==>c", response.getExecuteStepStrWithoutTime());
}