Skip to main content

All Questions

Filter by
Sorted by
Tagged with
0 votes
1 answer
123 views

JUnit Test method invocation with CompletableFuture.supplyAsync

in my class i have i class-field, which i'am verfing, that the method of this class-field is invoked three times. Now i moved the logic to "CompletableFuture.sypplyAsync" approach and it ...
Roma Kap's user avatar
  • 636
2 votes
1 answer
1k views

How to write JUnit5 or Mockito test for a retry mechanism built using Supplier<CompletableFuture> as a method param?

Have a common framework that isn't server specific which we use to import and re-use objects inside our microservices but can be used for any particular Java program which supports Java 8. Was tasked ...
PacificNW_Lover's user avatar
0 votes
1 answer
743 views

Java - Mockito - CompletableFutures - Unexpected Result of Tested Method

I have a very strange corner case where a future doesn't complete as expected once every couple of thousands of runs. Only way I'm able to consistently trigger the fault is to have the test run on ...
David S's user avatar
  • 187
4 votes
3 answers
7k views

How can I test a method call inside an asynchronous operation in unit testing

I have a method that first performs a series of actions, after which it starts an asynchronous task. I want to test this method, but I don’t understand how I can verify that the asynchronous operation ...
Silird's user avatar
  • 186