Example usage for org.apache.wicket.extensions.markup.html.captcha CaptchaImageResource getChallengeId

List of usage examples for org.apache.wicket.extensions.markup.html.captcha CaptchaImageResource getChallengeId

Introduction

In this page you can find the example usage for org.apache.wicket.extensions.markup.html.captcha CaptchaImageResource getChallengeId.

Prototype

public final String getChallengeId() 

Source Link

Document

Gets the id for the challenge.

Usage

From source file:org.apache.openmeetings.web.pages.auth.TestLoginUI.java

License:Apache License

private String getCaptcha(String path) throws ReflectiveOperationException, SecurityException {
    // hacks with reflection
    Image captchaImg = (Image) tester.getComponentFromLastRenderedPage(path);
    Method m1 = Image.class.getDeclaredMethod("getImageResource");
    m1.setAccessible(true);//from   w  w w .j a va  2  s . com
    CaptchaImageResource captcha = (CaptchaImageResource) m1.invoke(captchaImg);
    Method m2 = CaptchaImageResource.class.getDeclaredMethod("getImageData", Attributes.class);
    m2.setAccessible(true);
    m2.invoke(captcha, (Attributes) null);
    return captcha.getChallengeId();
}