*/\r
private List<AuditListener> auditListeners = new ArrayList<AuditListener>();\r
\r
+ private String principal;\r
+\r
@SuppressWarnings("unchecked")\r
public void setSession( Map map )\r
{\r
@SuppressWarnings( "unchecked" )\r
protected String getPrincipal()\r
{\r
+ if ( principal != null )\r
+ {\r
+ return principal;\r
+ }\r
return ArchivaXworkUser.getActivePrincipal( ActionContext.getContext().getSession() );\r
}\r
+ \r
+ void setPrincipal( String principal )\r
+ {\r
+ this.principal = principal;\r
+ }\r
}\r
searchControl.replay();
daoControl.replay();
+ action.setPrincipal( "user" );
String result = action.quickSearch();
assertEquals( Action.SUCCESS, result );
searchControl.replay();
daoControl.replay();
+ action.setPrincipal( "user" );
String result = action.quickSearch();
assertEquals( Action.SUCCESS, result );
userReposControl.replay();
+ action.setPrincipal( "user" );
String result = action.quickSearch();
assertEquals( GlobalResults.ACCESS_TO_NO_REPOS, result );
userReposControl.replay();
searchControl.replay();
+ action.setPrincipal( "user" );
String result = action.quickSearch();
assertEquals( Action.INPUT, result );
searchControl.replay();
userReposControl.replay();
-
+
+ action.setPrincipal( "user" );
String result = action.filteredSearch();
assertEquals( Action.SUCCESS, result );