Wen I run my tests:
@RunWith(PowerMockRunner.class)
@PrepareForTest(MyStuff.class)
public class MyStuffTest { ..whatever
After I added ZonedDateTime
class to that code it stared failing with the following error:
java.lang.IllegalStateException: Failed to transform class with name MyCode Reason: [source error] toInstant() not found in java.time.ZonedDateTime
Somewhere in my code I have:
long longTimeNoSee = ZonedDateTime.parse(getateTimeString()).toInstant().toEpochMilli();
I guess it is a bug in powermock
. But maybe someone got some idea (?)