Skip to content

Commit

Permalink
Fix error message when there are multiple sign in pages annotated #207
Browse files Browse the repository at this point in the history
  • Loading branch information
aldaris committed Sep 30, 2024
1 parent 6455b44 commit 6ad3b20
Showing 1 changed file with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -98,12 +98,12 @@ protected Class<? extends AbstractAuthenticatedWebSession> getWebSessionClass()
@Override
protected Class<? extends WebPage> getSignInPageClass() {
if(classCandidates.getSignInPageCandidates().size() <= 0){
throw new IllegalStateException("Couln't find sign in page - please annotate the sign in page with @" + WicketSignInPage.class.getName());
throw new IllegalStateException("Couldn't find sign in page - please annotate the sign in page with @" + WicketSignInPage.class.getName());
}
if(classCandidates.getSignInPageCandidates().size() > 1 ){
String message = "Multiple sign in pages found - please annotate exactly one class with @" + WicketSignInPage.class.getName();
message += "\n";
for(WicketClassCandidate<Page> classCandidate : classCandidates.getHomePageCandidates()) {
for (WicketClassCandidate<WebPage> classCandidate : classCandidates.getSignInPageCandidates()) {
message += "\t" + classCandidate.getCandidate() + "\n";
}
throw new IllegalStateException(message);
Expand All @@ -117,7 +117,7 @@ protected Class<? extends WebPage> getSignInPageClass() {
@Override
public Class<? extends Page> getHomePage() {
if(classCandidates.getHomePageCandidates().size() <= 0){
throw new IllegalStateException("Couln't find home page - please annotate the home page with @" + WicketHomePage.class.getName());
throw new IllegalStateException("Couldn't find home page - please annotate the home page with @" + WicketHomePage.class.getName());
}
if(classCandidates.getHomePageCandidates().size() > 1 ){
String message = "Multiple home pages found - please annotate exactly one class with @" + WicketHomePage.class.getName();
Expand Down Expand Up @@ -155,5 +155,4 @@ public List<WicketApplicationInitConfiguration> getConfigurations() {
public void setConfigurations(List<WicketApplicationInitConfiguration> configurations) {
this.configurations = configurations;
}

}

0 comments on commit 6ad3b20

Please sign in to comment.