Package org.kiwiproject.eureka
Class EurekaTestHelpers
- java.lang.Object
-
- org.kiwiproject.eureka.EurekaTestHelpers
-
public class EurekaTestHelpers extends Object
-
-
Constructor Summary
Constructors Constructor Description EurekaTestHelpers()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidresetStatsMonitor()THIS IS A TOTAL HACK!!!!!!!
-
-
-
Method Detail
-
resetStatsMonitor
public static void resetStatsMonitor()
THIS IS A TOTAL HACK!!!!!!!The
StatsMonitorcontains aprotected static finalScheduledExecutorServicethat when Eureka is shut down gets shutdown. There is not a way to "reset" that executor to a new one on each test so we have to do this reflection hack to reset it.Why don't we use Mockito's mockStatic or PowerMock's mockStatic to mock the method in
ServoControlwhich calls shutdown on the executor? Because...- Mockito's mockStatic does not support
doNothing()which is needed because the method is void. - PowerMock doesn't support Junit 5 without "tricking" the runner to fall back to Junit 4 which is yuck!
- Mockito's mockStatic does not support
-
-