Bill,
I'm using Spring/Mybatis for the application's data access layer. There is a spring bean service class that basically injects a mapper that does all the SQL calls. The class I'm trying to write unit test for is a legacy code that was originally implemented using
JDBC. I modified this legacy code to utilize Spring/Mybatis. And the only way I got it to work was to get the applicationcontext so that I can get the service beans to make the database calls.
I've tried to make this legacy code a bean by adding @Component/@Named so that I can inject the service class, however, this didn't work for me.
Thanks