How to use JUnit tests with Spring Roo? (Problems with EntityManager)

后端 未结 7 547
忘了有多久
忘了有多久 2021-01-02 19:40

I\'m trying to write a JUnit test for a Spring Roo project. If my test requires use of the entity classes, I get the following Exception:

java.lang.IllegalS         


        
7条回答
  •  自闭症患者
    2021-01-02 20:25

    This is an incredibly annoying problem with Spring Roo and I have not figured out the official solution for.

    But ... here are two workarounds:

    • Copy the spring-aspects jar to your project then add it to your Projects AspectJ Aspect Path
    • Use Maven to run your unit tests (and miss the green bar :( )

    For option one Right click on your project select Properties-> AspectJ Build -> Aspect Path Tab.

提交回复
热议问题