When using mockito to mock some methods behaviour, you may want to change your mocked method return value based on an argument value.
This is not obvious, but quite simple to achieve, thanks to this SO post :
when(mockObject.myMethod(anyString()))
.thenAnswer(invocation -> invocation.getArgument(0, String.class));