简体   繁体   English

空手道功能文件 + 调用 Java class 和 spring 注释,得到 PolyglotException

[英]Karate feature file + calling Java class with spring annotations, getting PolyglotException

I have some classes having Java code with spring annotation, however its observed when we call them from.feature file, getting org.graalvm.polyglot.PolyglotException.我有一些类具有 Java 代码和 spring 注释,但是当我们从.feature 文件调用它们时观察到它,得到 org.graalvm.polyglot.PolyglotException。 When removed those annotation it worked.删除这些注释后,它起作用了。 Now we have my libraries which use such classes, so can anybody help on same how to invoke spring flavoured classes from feature files.现在我们有了使用此类类的库,因此任何人都可以帮助解决如何从功能文件中调用 spring 风格的类。

Please note that re-using "production" objects in your test-suites is a common mistake, please don't do it.请注意,在您的测试套件中重复使用“生产”对象是一个常见错误,请不要这样做。 Because the risk is that when you re-factor some Java classes, you will never know if it really breaks some API consumers.因为风险在于,当你重构一些 Java 类时,你永远不会知道它是否真的破坏了一些 API 消费者。

You can assume that what you are trying to do is not supported by Karate.您可以假设空手道不支持您尝试做的事情。 If you follow this process, others will be in a better position to suggest a workaround: https://github.com/karatelabs/karate/wiki/How-to-Submit-an-Issue如果您遵循此过程,其他人将在更好的 position 中提出解决方法: https://github.com/karatelabs/karate/wiki/How-to-Submit-an-Issue

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM