@Test
public void shouldSetEncodingToUTF8() throws Exception {

when(context.getInitParameter(ENCODING)).thenReturn("UTF-8");

new WebXmlEncodingHandler("UTF-8").setEncoding(request, response);

verify(request).setCharacterEncoding("UTF-8");
verify(response).setCharacterEncoding("UTF-8");
}