### Question:
KaptchaPluginService { public String getHtml(HttpServletRequest request, String pluginId, Locale locale) { SecurityContextHolder.getContext(); ResourceBundle resourceBundle = ResourceBundle.getBundle("org.jtalks.jcommune.plugin.kaptcha.messages", locale); VelocityEngine engine = new VelocityEngine(getProperties()); engine.init(); Map<String, Object> model = new HashMap<>(); model.put(CAPTCHA_LABEL, resourceBundle.getObject("label.tip.captcha")); model.put(ALT_CAPTCHA, resourceBundle.getObject("alt.captcha.image")); model.put(ALT_REFRESH_CAPTCHA, resourceBundle.getObject("alt.captcha.update")); model.put(CAPTCHA_PLUGIN_ID, pluginId); model.put(FORM_ELEMENT_ID, getFormElementId(pluginId)); model.put(BASE_URL, getDeploymentRootUrl(request)); model.put(DATE, new DateTool()); return VelocityEngineUtils.mergeTemplateIntoString( engine, "org/jtalks/jcommune/plugin/kaptcha/template/captcha.vm", "UTF-8", model); } KaptchaPluginService(int width, int height, int length, String possibleSymbols); Map<String, String> validateCaptcha(UserDto userDto, Long pluginId); String getHtml(HttpServletRequest request, String pluginId, Locale locale); void refreshCaptchaImage(HttpServletRequest request, HttpServletResponse response); void removeCurrentCaptcha();  }### Answer:
@Test public void testGetHtml() throws Exception { Properties properties = createProperties(); when(service.getProperties()).thenReturn(properties); String actual = service.getHtml(request, "1", Locale.ENGLISH); assertTrue(actual.contains("<img class='captcha-img' " + "alt='Captcha' src='http: assertTrue(actual.contains("<img class='captcha-refresh' alt='Refresh captcha' " + "src='http: assertTrue(actual.contains("<input type='text' id='plugin-1' name='userDto.captchas[plugin-1]'")); assertTrue(actual.contains("placeholder='Captcha text' class='reg_input captcha'/>")); }