title: DateFormat UnitTest fails in Jenkins but not locally
body: <p>I've made a unit-test of a Service, when I execute the Jenkins job, every test method pass correctly, except one.<br>
  But this test method, works on my machine, both with Eclipse and using the <code>mvn</code> command.<br></p>
  
  <pre><code>    // TARGET_RUN_DATE_OF_YEAR = "2018-01-01"
      @Test
      public void dateToTimestamp() {
          Service service = getService();
  
          String df = "YYYY-MM-dd";
          String invalid = "INVALID";
  
          // Check success
          Timestamp timestamp = service.dateToTimestamp(TARGET_RUN_DATE_OF_YEAR, df);
          Assert.assertEquals(service.getTodayTimestamp(), timestamp); // &lt;-- Fail here
          // Check failure
          Assert.assertNull(service.dateToTimestamp(TARGET_RUN_DATE_OF_YEAR, invalid));
          Assert.assertNull(service.dateToTimestamp(invalid, df));
      }
  
  </code></pre>
  
  <p>The Service have mulitple methods:<br></p>
  
  <ul>
  <li><code>getTodayTimestamp</code> give today Timestamp, this method is tested, it works on my machine and on Jenkins.</li>
  <li><code>dateToTimestamp</code> takes a date and a dateFormat as Strings, and returns the date as a Timestamp, this method is the one not working.</li>
  </ul>
  
  <p>The <code>dateToTimestamp</code> method in the Service:<br></p>
  
  <pre><code>    private Timestamp dateToTimestamp(String date, DateFormat df) throws ParseException {
          return new Timestamp(df.parse(date).getTime());
      }
  
      @Override
      public Timestamp dateToTimestamp(String date, String dateFormatString) {
          try {
              DateFormat df = new SimpleDateFormat(dateFormatString);
              return dateToTimestamp(date, df);
          } catch (Exception e) {
              log.warn("Exception during conversion of date to timestamp, exception : {}", e);
              return null;
          }
      }
  </code></pre>
  
  <p>As I previously said, the test work perfectly on my pc, but not on Jenkins (adding the <code>@Ignore</code> annotations to this method, makes the job successful).<br>
  When launching the job, I get this error:</p>
  
  <blockquote>
    <p>Failed tests:   dateToTimestamp(com.test.service.ServiceImplTest): expected:&lt;2018-01-01 00:00:00.0> but was:&lt;2017-12-31 00:00:00.0></p>
  </blockquote>
  
  <p>What I can assure, is that even in Jenkins, the <code>dateToTimestamp</code> method takes the parameters <code>TARGET_RUN_DATE_OF_YEAR</code>, which is <code>"2018-01-01"</code> and the dateFormart String as <code>"YYYY-MM-dd"</code>. But still returns <code>2017-12-31 00:00:00.0</code> as Timestamp.<br><br>
  <strong>Any ideas?</strong></p>