0

I have a piece of application code which retrieves a system property to get log path. This piece of code is executed by a batch job.

I have written a test case using JobLauncherTestUtils class to launch this job. How can i mock the system property. When i plainly set system property using a static block or using @Before, system property value is not available when job is invoked as job is launched in a new thread. How can i pass the system property value to the job invoked through JobLauncherTestUtils

poorna chandra
  • 27
  • 1
  • 1
  • 8
  • Can you please share your test setup to be able to help you? https://stackoverflow.com/help/mcve – Mahmoud Ben Hassine Dec 03 '18 at 08:51
  • Possible duplicate of [System.setProperty used by a thread impacts other thread in communication to external network elements. How to resolve it?](https://stackoverflow.com/questions/9579958/system-setproperty-used-by-a-thread-impacts-other-thread-in-communication-to-ext) – Raedwald Dec 03 '18 at 16:41

0 Answers0