• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Bear Bibeault
  • Junilu Lacar
  • Martin Vashko
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Scott Selikoff
  • salvin francis
  • Piet Souris

Mockit problem for JPA

 
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I am newbie to Mockit framework. My application is build on spring mvc, and jpa. The flow is from controller, service layer will call, and my serivce layer will call the DAO layer where I am using JPA's. I want to test my controller using mockit. I tried in the following way but getting null pointer execptions.
I am attaching java file for your refernece. The test class is for controller is as follows.

The exception I am getting is null pointer exception at
ModelAndView acutalModelView=ecpProductionController.getPfgProductionViewResultPage(null, "30415","10-Jul-2011", "01");

The service class is as follows

The DAO class is

Please help me whether I am going in the right direction or not and help me in resolvoing the issue. I have written the test case only for getPfgProductionViewResultPage for the controller.

Any help is appreciated

 
Listen. That's my theme music. That's how I know I'm a super hero. That, and this tiny ad told me:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!