### Question:
KaptchaPlugin extends StatefullPlugin implements RegistrationPlugin, ExtendedPlugin { @Override public String getHtml(HttpServletRequest request, String pluginId, Locale locale) { return getService().getHtml(request, pluginId, locale); }  @Override boolean supportsJCommuneVersion(String version); @Override String getName(); @Override List<PluginProperty> getConfiguration(); @Override List<PluginProperty> getDefaultConfiguration(); @Override String translateLabel(String code, Locale locale); @Override Map<String, String> registerUser(UserDto userDto, Long pluginId); @Override Map<String, String> validateUser(UserDto userDto, Long pluginId); @Override String getHtml(HttpServletRequest request, String pluginId, Locale locale); @Override Object doAction(String pluginId, String action, HttpServletRequest request, HttpServletResponse response);  }### Answer:
@Test public void testGetHtml() throws Exception { String pluginId = "1"; KaptchaPluginService service = mock(KaptchaPluginService.class); when(kaptchaPlugin.getService()).thenReturn(service); String newLine = System.getProperty("line.separator"); String expected = "<div class='control-group'>" + newLine + " <div class='controls captcha-images'>" + newLine + " <img class='captcha-img' alt='Captcha' src='http: " <img class='captcha-refresh' alt='Refresh captcha'" + " src='http: " </div>" + newLine + " <div class='controls'>" + newLine + " <input type='text' id='plugin-1' name='userDto.captchas[plugin-1]'" + newLine + " placeholder='Captcha text' class='reg_input captcha'/>" + newLine + " </div>" + newLine + "</div>"; when(service.getHtml(null, pluginId, Locale.ENGLISH)).thenReturn(expected); String actual = kaptchaPlugin.getHtml(null, pluginId, Locale.ENGLISH); assertEquals(actual, expected); }