1

add Multiple tests And rename 1 Method

This commit is contained in:
killerber4t
2020-03-26 16:00:16 +01:00
parent f15d1f850d
commit 2443179ad5
3 changed files with 91 additions and 25 deletions

View File

@ -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()))