@Test
public void shouldReturnPublicSocialWorkspace() throws Exception {
try (CoreSession newSession = openSessionAs("John")) {
SocialWorkspaceService service = Framework.getService(SocialWorkspaceService.class);
List<SocialWorkspace> socialWorkspaces = service.getDetachedPublicSocialWorkspaces(newSession);
assertEquals(1, socialWorkspaces.size());
String query = String.format("Select * From %s ",
SocialConstants.SOCIAL_WORKSPACE_TYPE);
DocumentModelList docs = newSession.query(query);
assertEquals(0, docs.size());
DatabaseHelper.DATABASE.sleepForFulltext(); // we'll do a search
socialWorkspaces = service.searchDetachedPublicSocialWorkspaces(
newSession, "marketing");
assertEquals(1, socialWorkspaces.size());
}
}