MBeanStringSanitizer { String urlDecode(String name, String encoding) throws UnsupportedEncodingException { return URLDecoder.decode(name, encoding); }    }
@Test public void testUrlDecodeDecodesSlashes() throws Exception { String testString = "this%2Fhas%2Fslashes"; String sanitizedString = sanitizer.urlDecode(testString, "UTF-8"); assertEquals("this/has/slashes", sanitizedString); }
@Test(expected= UnsupportedEncodingException.class) public void testUrlDecodeThrowsUnsupportedEncodingException() throws Exception { sanitizer.urlDecode("some_string_with_encoding_%2F", "unsupported_encoding"); }