PowerMockito and Java 8 ZonedDateTime toInstant() not found

Use powermockito version 1.6.6 or higher.

Also, make sure to use latest javassist version or at least 3.23.0-GA


It seems to be a bug in Powermock indeed. See

https://github.com/jayway/powermock/issues/557

You might want to add your examples and vote for this issue.

UPDATE: According to Powermock it seems to be an issue in javassist: https://github.com/jboss-javassist/javassist/issues/43


I had the same issue. Fixed it by using Instant.from().

So in your case, below should work: ZonedDateTime.parse(Instant.from(getateTimeString())).toEpochMilli();