I have a code that looks somehow like this:
MyObject getMyObject() {
Instant now = Instant.now();
return myService.doSomething(now);
}
I know that PowerMock is not supported in JUnit 5, but I am wondering maybe there is a solution at least for standard API like dates.
Right now I am mocking the Instant
instance with Mockito.any()
which is incorrect as my test won't fail if I pass a wrong Instant
.