Fix issue with inaccurate results returning from content URL query

* added integration test for MNT scenarios
* checked for nodeId's that don't exist in query results
* changed DAO method to return set of node references rather tha nodeId strings
* turned off logging by default
This commit is contained in:
Roy Wetherall
2019-08-29 12:28:04 +10:00
parent 4518cd8615
commit e282c0584e
6 changed files with 51 additions and 45 deletions

View File

@@ -116,8 +116,8 @@ public class ContentBinDuplicationUtilityUnitTest
@Test
public void testHasAtLeastOneOtherReference()
{
Set<String> multipleReferences = new HashSet<>();
Collections.addAll(multipleReferences, NODE_REF.getId(), NODE_REF2.getId());
Set<NodeRef> multipleReferences = new HashSet<>();
Collections.addAll(multipleReferences, NODE_REF, NODE_REF2);
when(contentService.getReader(NODE_REF, ContentModel.PROP_CONTENT)).thenReturn(contentReader);
when(contentService.getReader(NODE_REF, ContentModel.PROP_CONTENT).getContentUrl()).thenReturn(CONTENT_URL);
@@ -132,7 +132,7 @@ public class ContentBinDuplicationUtilityUnitTest
@Test
public void testHasNoOtherReference()
{
Set<String> singleReference = Collections.singleton(NODE_REF.getId());
Set<NodeRef> singleReference = Collections.singleton(NODE_REF);
when(contentService.getReader(NODE_REF, ContentModel.PROP_CONTENT)).thenReturn(contentReader);
when(contentService.getReader(NODE_REF, ContentModel.PROP_CONTENT).getContentUrl()).thenReturn(CONTENT_URL);
@@ -147,7 +147,7 @@ public class ContentBinDuplicationUtilityUnitTest
@Test
public void testHasNoReferences()
{
Set<String> noReferences = Collections.<String> emptySet();
Set<NodeRef> noReferences = Collections.<NodeRef> emptySet();
when(contentService.getReader(NODE_REF, ContentModel.PROP_CONTENT)).thenReturn(contentReader);
when(contentService.getReader(NODE_REF, ContentModel.PROP_CONTENT).getContentUrl()).thenReturn(CONTENT_URL);