Hello,
I do have some controllers reading the conditional get header form an request.
In detail the "If-Modified-Since" header is required.
My Unit tests looks as follows:
So local all tests are fine and pass. On the Jenkins I'll get an Exception:Code:// setup date Date currentDate = mu2.getLastModified(); Calendar calendar = Calendar.getInstance(); calendar.setTime(currentDate); calendar.add(Calendar.DATE, 1); //Sat, 12 Aug 1995 13:30:00 GMT+0000 //EEE, dd.MM.yyyy HH:mm:ss Z SimpleDateFormat formatter = new SimpleDateFormat("EEE, dd MMM yyyy HH:mm:ss zZ"); formatter.setTimeZone((TimeZone.getTimeZone("GMT"))); // setup request request.setMethod("GET"); request.setRequestURI("/customer"); request.addHeader("Accept", "application/json"); request.addHeader("If-Modified-Since", formatter.format((calendar.getTime())));
org.springframework.beans.ConversionNotSupportedEx ception: Failed to convert value of type 'java.lang.String' to required type 'java.util.Date'; nested exception is java.lang.IllegalStateException: Cannot convert value of type [java.lang.String] to required type [java.util.Date]: no matching editors or conversion strategy found
How is that possible?
Local everything allright, on the jenkins thos errors?
I would appreciate any help


Reply With Quote