I am trying to mock a function for various results. First, I mocked it for throwing an exception as follows:
Mockito.when(ClassName.methodName(Matchers.any(), Matchers.any())).thenThrow(new ExceptionName());
Now, I want to mock for a case when it return some output. So, I am trying as follows:
Mockito.when(ClassName.methodName(Matchers.any(), Matchers.any())).thenReturn(output);
But it is throwing exception(Maybe because I have already mocked it to throw exception)
How should I unmock it, so that I can use it to give proper output?