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
How about just creating a String with a bad encoding name? See
String
public String(byte bytes[], int offset, int length, String charsetName)
Mocking String is almost certainly a bad idea.