fix(接口测试): 插件获取不到环境信息

This commit is contained in:
AgAngle 2024-05-13 15:21:16 +08:00 committed by Craftsman
parent 5054b764d8
commit c4ffa6fa3a
1 changed files with 4 additions and 2 deletions

View File

@ -94,8 +94,10 @@ public class ApiPluginService {
Map<Class<? extends AbstractMsTestElement>, String> testElementPluginMap = new HashMap<>();
List<PluginWrapper> plugins = pluginLoadService.getMsPluginManager().getPlugins();
for (PluginWrapper plugin : plugins) {
List<Class<? extends MsTestElement>> extensionClasses = plugin.getPluginManager().getExtensionClasses(MsTestElement.class);
extensionClasses.forEach(clazz -> testElementPluginMap.put((Class<? extends AbstractMsTestElement>) clazz, plugin.getPluginId()));
if (plugin.getPlugin() instanceof AbstractApiPlugin) {
List<Class<? extends MsTestElement>> extensionClasses = plugin.getPluginManager().getExtensionClasses(MsTestElement.class, plugin.getPluginId());
extensionClasses.forEach(clazz -> testElementPluginMap.put((Class<? extends AbstractMsTestElement>) clazz, plugin.getPluginId()));
}
}
return testElementPluginMap;
}