use of org.alfresco.repo.search.impl.solr.facet.handler.FacetLabelDisplayHandler in project alfresco-repository by Alfresco.
the class SolrFacetQueriesDisplayHandlersTest method testGetUserNameDisplayHandler.
/**
* User name display handler test.
*
* @throws Exception
*/
@Test
public void testGetUserNameDisplayHandler() throws Exception {
FacetLabelDisplayHandler userNameHandler = displayHandlerRegistry.getDisplayHandler("@{http://www.alfresco.org/model/content/1.0}creator");
assertNotNull(userNameHandler);
String randomUserName = "randomUserName" + System.currentTimeMillis();
FacetLabel name = userNameHandler.getDisplayLabel(randomUserName);
assertNotNull(name);
assertEquals("There is no user with the username [" + randomUserName + "], hence, the handler should return the passed-in username.", randomUserName, name.getLabel());
name = userNameHandler.getDisplayLabel(AuthenticationUtil.getAdminUserName());
assertNotNull(name);
assertEquals("Expected admin's full name.", "Administrator", name.getLabel());
}
Aggregations