Skip to content

Commit

Permalink
ALFREDAPI-562: Fix search test
Browse files Browse the repository at this point in the history
  • Loading branch information
WimCrols committed Dec 10, 2024
1 parent 1428256 commit d84ac91
Showing 1 changed file with 6 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import eu.xenit.alfred.api.search.ISearchService;
import eu.xenit.alfred.api.search.QueryBuilder;
import eu.xenit.alfred.api.search.SearchQuery;
import eu.xenit.alfred.api.search.SearchQueryConsistency;
import eu.xenit.alfred.api.search.SearchQueryResult;
import eu.xenit.alfred.api.tests.JavaApiBaseTest;
import java.io.Serializable;
Expand All @@ -28,10 +29,8 @@
import org.alfresco.service.cmr.security.PersonService;
import org.alfresco.service.namespace.QName;
import org.junit.After;
import org.junit.AfterClass;
import org.junit.Assert;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
Expand Down Expand Up @@ -144,13 +143,13 @@ public void testSearch() {

SearchQuery query = new SearchQuery();
query.setQuery(new QueryBuilder()
.startAnd()
.term("path", "/app:company_home/cm:" + mainTestFolderName + "//*") // x2 slash means: recurse
.term("type", "cm:content")
.end()
.property(PROP_QNAME_VERSION_LABEL.toString(), PROPERTY_VALUE, true)
.create());
query.setConsistency(SearchQueryConsistency.TRANSACTIONAL);
SearchQueryResult result = apixSearchService.query(query);

Assert.assertEquals(1, result.totalResultCount);
Assert.assertEquals(nodeAllowed.toString(), result.getNoderefs().get(0));
}


Expand All @@ -167,12 +166,8 @@ public void testGetNodeMetadata() {
try {
apixNodeService.getMetadata(new eu.xenit.alfred.api.data.NodeRef(nodeForbidden.toString()));
Assert.fail("Expected AccessDeniedException");
} catch (AccessDeniedException e) {
}
catch (AccessDeniedException e) {
}

logger.error("WIM: Your father would be proud, Fox"); // REMOVE ME
}


}

0 comments on commit d84ac91

Please sign in to comment.