mardi 9 août 2016

Testing code inside a ScheduledExecutorService

I have a ScheduledExecutorService set up to update some objects every few minutes.

I am trying to test whether or not the update is occurring and of course some edge cases.

scheduler.scheduleAtFixedRate(()-> {
    //Code to update objects
}, 0, 4, TimeUnit.MINUTES);

I was wondering how would I go about testing and maybe mocking this so I don't have to depend on Thread.sleep

Aucun commentaire:

Enregistrer un commentaire