• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Rob Spoor
  • Devaka Cooray
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
  • Tim Holloway
Bartenders:
  • Jj Roberts
  • Al Hobbs
  • Piet Souris

How to test a dynamic search method that employs JPA Criteria API using JUnit 5?

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Everyone! I'm trying to get 100% code coverage for a particular service class, but a dynamic search method that I successfully implemented is denying me from obtaining that. Please help. The method uses the criteria api to return search results from a MySQL database. Here is the method.



All lines are covered except for when it hits the 2nd to the last line. It throws a NullPointerException. Here is the unit test so far:


 
reply
    Bookmark Topic Watch Topic
  • New Topic