title: How to write junit test case for thread run method
body: <p>I have public void run() method. Inside of run method i'm calling three(CurrentDate,generateReport and update) more methods like below. My doubt is, for run method i don't have any parameter to pass Details object. How to pass Details object to run method from junit test method. I have googled lot but no solution.</p>
  
  <pre><code>@Override
  public void run() {
  
      while(true) { 
          Details Obj = ruleQueue.peek();
          if(Obj != null &amp;&amp; CurrentDate(Obj)) {
              ruleQueue.poll();
  
              Generator generator = new Generator();
              generator.generateReport(Obj.getId(),Obj.getLastExec(), ruleObj.getnextExec());
  
              updateDate(Obj);
              try {
                  dao.update(Obj);
  
              }
              catch (DocumentClientException e) {
                  logger.error(e);
              }
          }
      }
  }
  </code></pre>