on 2018 Apr 02 2:17 PM
when I run Junit test class i am facing NoClassDefFoundError: CustomerModel even after ant clean all and .class file is generated successfully.
Request clarification before answering.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I have found using:
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(locations =
{
"classpath:/global-servicelayer-spring.xml",
"classpath:/global-core-spring.xml"
}
In your unit test helps to define where CustomerModel is instantiated. Make sure you use the correct spring config file where you are instantiating it.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Please make sure the classes are generated in the right folder. You get classnotfound exception when JVM cant find the class at specified location.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.