Expand my Community achievements bar.

Guidelines for the Responsible Use of Generative AI in the Experience Cloud Community.
SOLVED

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

Avatar

Level 3

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.  

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

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.

View solution in original post

4 Replies

Avatar

Community Advisor

@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?

 

Avatar

Level 3
[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

Avatar

Correct answer by
Community Advisor

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.

Avatar

Community Advisor

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



Arun Patidar