add Multiple tests And rename 1 Method
This commit is contained in:
@ -77,7 +77,7 @@ public class GroupService {
|
||||
* @throws EventException Projektionsfehler
|
||||
*/
|
||||
//TODO Rename
|
||||
public List<Group> getAllGroupWithVisibilityPublic(String userId) throws EventException {
|
||||
public List<Group> getAllGroupsWithVisibilityPublic(String userId) throws EventException {
|
||||
List<Event> groupEvents = eventService.translateEventDTOs(eventRepository.findAllEventsByType("CreateGroupEvent"));
|
||||
groupEvents.addAll(eventService.translateEventDTOs(eventRepository.findAllEventsByType("UpdateGroupDescriptionEvent")));
|
||||
groupEvents.addAll(eventService.translateEventDTOs(eventRepository.findAllEventsByType("UpdateGroupTitleEvent")));
|
||||
@ -126,10 +126,10 @@ public class GroupService {
|
||||
//Todo Rename
|
||||
public List<Group> findGroupWith(String search, Account account) throws EventException {
|
||||
if (search.isEmpty()) {
|
||||
return getAllGroupWithVisibilityPublic(account.getName());
|
||||
return getAllGroupsWithVisibilityPublic(account.getName());
|
||||
}
|
||||
|
||||
return getAllGroupWithVisibilityPublic(account.getName())
|
||||
return getAllGroupsWithVisibilityPublic(account.getName())
|
||||
.parallelStream()
|
||||
.filter(group -> group.getTitle().toLowerCase().contains(search.toLowerCase())
|
||||
|| group.getDescription().toLowerCase().contains(search.toLowerCase()))
|
||||
|
||||
Reference in New Issue
Block a user