Why test cases are passing in my local but fail in Jenkins run | Community
Skip to main content
Level 2
February 15, 2023
Solved

Why test cases are passing in my local but fail in Jenkins run

  • February 15, 2023
  • 3 replies
  • 8304 views

Hi All,
We write a test cases for servlet at the time of running test cases it passing in my local. but we tried to move the code to higher environments by Jenkins  it get failed we get null pointer exception why it was coming anybody have any idea Please i need some suggestions.
Thankyou.  

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by Prince_Shivhare

Hey, I think you should recheck the versions mentioned on Jenkins and on your local. try to identify which method is giving null pointer and which Junit version it is using.

3 replies

Jagadeesh_Prakash
Community Advisor
Community Advisor
February 15, 2023

@dh54220 

 

In your local IDE you might be using Junit5 version which will pass in your local. But in jenkins their might be version miss match. Can you post the complete error trace that you are facing in jenkins?

 

dh54220Author
Level 2
February 15, 2023
[ERROR]   PressReleaseServletTest.testDoGetWithParams:101 » NullPointer
[ERROR]   PressReleaseServletTest.testDoGetWithoutParams:87 » NullPointer

 taking same code as pull i am testing in my local test cases are passng but it get failed with same code same test cases it get failed by Jenkins run

Prince_Shivhare
Community Advisor
Prince_ShivhareCommunity AdvisorAccepted solution
Community Advisor
February 15, 2023

Hey, I think you should recheck the versions mentioned on Jenkins and on your local. try to identify which method is giving null pointer and which Junit version it is using.

arunpatidar
Community Advisor
Community Advisor
February 15, 2023

Please check java/jdk version installed in local and jenkins.

Arun Patidar