开发者

Unit Testing Groovy Class Spring and Visibility

开发者 https://www.devze.com 2023-02-14 05:15 出处:网络
I am attempting to test a Groovy class in Spring. I basically have a Java interface. And wrote a Groovy class to implement that interface.

I am attempting to test a Groovy class in Spring. I basically have a Java interface. And wrote a Groovy class to implement that interface.

I put the Groovy class in the same package. When I开发者_StackOverflow社区 go to write a unit test every Java class is visible, but the Groovy class is not visible. I want to write a unit test on the groovy class? Maybe I am just dense, but I can't figure out how to do this. Any help would be greatly appreciated.


I recently had this same requirements and followed the directions here (http://groovy.codehaus.org/Embedding+Groovy) to get an instance of the groovy class to work with and test. Specifically, the solution I used was located under the "If you have an interface you wish to use which you implement in the Groovy script you can use it as follows:"

0

精彩评论

暂无评论...
验证码 换一张
取 消