I have a static method in a class. the method is not final. I keep getting a when() requires an argument which has to be 'a method call on a mock' error. Below is my code.
mockStatic(HomefeedExperimentUtils.class);
when(HomefeedExperimentUtils.getGroupAndActivateExperiment(
"link_stock_signal_filter_exp")).thenReturn(
"treatment");
I've also tried:
HomefeedExperimentUtils mock = org.mockito.Mockito.mock(HomefeedExperimentUtils.class);
when(mock.getGroupAndActivateExperiment(
"link_stock_signal_filter_exp")).thenReturn(
"treatment");
Any help with be appreciated.
Thanks!