diff --git a/notes-service/src/main/java/org/exoplatform/wiki/service/impl/WikiServiceImpl.java b/notes-service/src/main/java/org/exoplatform/wiki/service/impl/WikiServiceImpl.java index bab59cc05..3aed47dd6 100644 --- a/notes-service/src/main/java/org/exoplatform/wiki/service/impl/WikiServiceImpl.java +++ b/notes-service/src/main/java/org/exoplatform/wiki/service/impl/WikiServiceImpl.java @@ -402,7 +402,6 @@ public List searchSpaces(String keyword) throws WikiException { // search by keyword SpaceFilter spaceFilter = new SpaceFilter(keyword); spaceFilter.setRemoteId(currentUser); - spaceFilter.setAppId("Wiki"); SpaceService spaceService = ExoContainerContext.getCurrentContainer() .getComponentInstanceOfType(SpaceService.class); diff --git a/notes-service/src/test/java/org/exoplatform/wiki/jpa/search/WikiElasticSearchServiceConnectorTest.java b/notes-service/src/test/java/org/exoplatform/wiki/jpa/search/WikiElasticSearchServiceConnectorTest.java index 75634b91b..7d0219acb 100644 --- a/notes-service/src/test/java/org/exoplatform/wiki/jpa/search/WikiElasticSearchServiceConnectorTest.java +++ b/notes-service/src/test/java/org/exoplatform/wiki/jpa/search/WikiElasticSearchServiceConnectorTest.java @@ -27,11 +27,14 @@ import org.exoplatform.social.core.identity.provider.OrganizationIdentityProvider; import org.exoplatform.social.core.manager.IdentityManager; import org.exoplatform.social.core.space.SpaceListAccess; +import org.exoplatform.social.core.space.SpaceListAccessType; import org.exoplatform.social.core.space.spi.SpaceService; import org.exoplatform.social.core.storage.api.SpaceStorage; import org.exoplatform.wiki.service.search.SearchResult; import org.exoplatform.wiki.utils.Utils; +import io.meeds.social.core.search.SpaceSearchConnector; + @RunWith(MockitoJUnitRunner.Silent.class) public class WikiElasticSearchServiceConnectorTest extends AbstractKernelTest { @@ -45,10 +48,13 @@ public class WikiElasticSearchServiceConnectorTest extends AbstractKernelTest { @Mock private SpaceService spaceService; - + @Mock private SpaceStorage spaceStorage; + @Mock + private SpaceSearchConnector spaceSearchConnector; + @Mock private ConfigurationManager configurationManager; @@ -129,8 +135,9 @@ protected String getPermissionFilter() { + " \"pre_tags\" : [\"\"],\n" + " \"post_tags\" : [\"\"]\n" + " }\n" + " }\n" + " }\n" + "}"); when(spaceService.getMemberSpaces("__system")).thenReturn(new SpaceListAccess(spaceStorage, + spaceSearchConnector, "__system", - SpaceListAccess.Type.MEMBER)); + SpaceListAccessType.MEMBER)); when(spaceStorage.getMemberSpacesCount("__system")).thenReturn(0); when(identityManager.getOrCreateIdentity(OrganizationIdentityProvider.NAME,"__system")).thenReturn(new org.exoplatform.social.core.identity.model.Identity("1")); diff --git a/notes-service/src/test/java/org/exoplatform/wiki/mock/MockSpaceService.java b/notes-service/src/test/java/org/exoplatform/wiki/mock/MockSpaceService.java index 0eff30b07..7729efcdf 100644 --- a/notes-service/src/test/java/org/exoplatform/wiki/mock/MockSpaceService.java +++ b/notes-service/src/test/java/org/exoplatform/wiki/mock/MockSpaceService.java @@ -240,11 +240,7 @@ public Space createSpace(Space space, String creator, List identities) return null; } - public void saveSpace(Space space, boolean isNew) throws SpaceException { - - } - - public void renameSpace(Space space, String newDisplayName) throws SpaceException { + public void createSpace(Space space, boolean isNew) throws SpaceException { } @@ -252,10 +248,6 @@ public void renameSpace(Space space, String newDisplayName, String remoteId) thr } - public void deleteSpace(String spaceId) throws SpaceException { - - } - public void initApp(Space space) throws SpaceException { } @@ -268,22 +260,6 @@ public void deInitApps(Space space) throws SpaceException { } - public void addMember(String spaceId, String userId) throws SpaceException { - - } - - public void removeMember(String spaceId, String userId) throws SpaceException { - - } - - public List getMembers(Space space) throws SpaceException { - return null; - } - - public List getMembers(String spaceId) throws SpaceException { - return null; - } - public void setLeader(Space space, String userId, boolean isLeader) throws SpaceException { } @@ -308,10 +284,6 @@ public boolean isOnlyLeader(String spaceId, String userId) throws SpaceException return false; } - public boolean isMember(String spaceId, String userId) throws SpaceException { - return false; - } - public boolean hasAccessPermission(String spaceId, String userId) throws SpaceException { return false; } @@ -380,10 +352,6 @@ public void removeApplication(String spaceId, String appId, String appName) thro } - public void updateSpaceAccessed(String remoteId, Space space) throws SpaceException { - - } - public List getLastAccessedSpace(String remoteId, String appId, int offset, int limit) throws SpaceException { return null; }