title: Integration test for Java ExecutorService
body: <p>I have an application which takes uses ExecutorService, to creates multiple threads &amp; execute certain operation asynchronously.</p>
  
  <pre><code>for (final Product product : products) {
      executorService.submit(new Runnable() {
          @Override
          public void run() {
              updateFewAttributes(product);
          }
      });
  }
  </code></pre>
  
  <p>I am trying to write an integration test to verify, whether the operation has been performed correctly.
  Since the operation is asynchronous, finding it difficult to assert the expected attributes.</p>
  
  <p>Tried to do awaitTermination before asserting, but this doesn't seem to work. </p>
  
  <pre><code>executorService.awaitTermination(3, TimeUnit.MINUTES);
  </code></pre>