Add WicketTester#executeBehavior(Class) to run a behavior by its type

Aperta
#1,955 2 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

@aryankalantri ci sta già lavorando.

Dal 21/11/2026.

  • #1978 di @aryankalantri — aperta

Valutazione

Difficoltà
4/5
Tempo stimato
1-2 giorni
Idoneità per principianti
67/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
java

Direzione di ricerca

Read BaseWicketTester.java beside executeBehavior(AbstractAjaxBehavior) and the listed BaseWicketTesterTest.java tests. Decide whether lookup should take a component and behavior class or search the page, then document the public API with Javadoc and the next release's @since. Done means tests cover clear failures for no match and multiple matches.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

good first issue

WicketTester#executeBehavior(AbstractAjaxBehavior) needs the behavior instance. A behavior added inside the tested component is usually not reachable from the test, so the test has to dig it out first:

MyPanel panel = tester.startComponentInPage(new MyPanel());
panel.getBehaviors(AbstractDefaultAjaxBehavior.class).forEach(tester::executeBehavior);

A variant that finds the behavior by type would make this one call.

Where

wicket-tester/src/main/java/org/apache/wicket/util/tester/BaseWicketTester.java, next to executeBehavior(AbstractAjaxBehavior). WicketTester is shipped to applications, so this is public API: it needs Javadoc and an @since with the next release.

Done when

  • A method that takes a component and a behavior class is probably more useful than one that searches the whole page; decide which and explain it in the pull request. It fails with a clear message when there is no match or more than one.
  • Tests in wicket-core-tests/src/test/java/org/apache/wicket/util/tester/BaseWicketTesterTest.java.

Background

Originally requested as WICKET-6487.


Part of #1945. This issue is meant for a first contribution to Wicket. To work on it, leave a comment so others know; a claim without a pull request lapses after two weeks. Questions are welcome, here on the issue or on [email protected]. Start your branch from master, and see Send a pull request to Wicket for building and testing.

Lingua principale
Java
Stelle
800
Fork
437
Merge medio
21h 36m
PR unite (30g)
167

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di apache/wicket

Tutte le issue di apache/wicket

Issue simili

Altre issue su Java

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.