I need to simulate a test scenario in which I call the getBytes() method of a String object and I get an UnsupportedEncodingException.
getBytes()
I have tried to achie
instead of mocking string inject string value at setup method as below
public void setup() throws IllegalAccessException { FieldUtils.writeField(yourTestClass, "stringVariableName", "value", true); }