1

Fix merge confilcts

Co-Authored-By: andibuls <andibuls@users.noreply.github.com>
Co-Authored-By: Lukas Ettel <lukasettel@users.noreply.github.com>
This commit is contained in:
XXNitram
2020-03-27 15:26:32 +01:00
parent aa5481afdb
commit 2e3f705544
3 changed files with 7 additions and 3 deletions

View File

@ -287,9 +287,11 @@ public class WebController {
public String acceptInvite(KeycloakAuthenticationToken token,
Model model,
@PathVariable("link") String link) throws EventException {
model.addAttribute("account", keyCloakService.createAccountFromPrincipal(token));
Group group = userService.getGroupById(inviteService.getGroupIdFromLink(link));
validationService.throwIfGroupNotExisting(group.getTitle());
model.addAttribute("account", keyCloakService.createAccountFromPrincipal(token));
model.addAttribute("group", group);
//controllerService.addUser(keyCloakService.createAccountFromPrincipal(token), group.getId());

View File

@ -42,7 +42,7 @@ public class ControllerService {
private final InviteService inviteService;
private final Logger logger;
public ControllerService(EventService eventService, UserService userService, ValidationService validationService) {
public ControllerService(EventService eventService, UserService userService, ValidationService validationService, InviteService inviteService) {
this.eventService = eventService;
this.userService = userService;
this.validationService = validationService;

View File

@ -19,6 +19,7 @@ class ControllerServiceTest {
ControllerService controllerService;
EventService eventService;
UserService userService;
ValidationService validationService;
EventRepository eventRepository;
GroupService groupService;
JsonService jsonService;
@ -33,9 +34,10 @@ class ControllerServiceTest {
eventService = new EventService(jsonService, eventRepository);
groupService = new GroupService(eventService, eventRepository);
userService = new UserService(groupService, eventService);
validationService = new ValidationService(userService, groupService);
inviteRepository = mock(InviteRepository.class);
inviteService = new InviteService(inviteRepository);
controllerService = new ControllerService(eventService, userService, inviteService);
controllerService = new ControllerService(eventService, userService, validationService, inviteService);
Set<String> roles = new HashSet<>();
roles.add("l");
account = new Account("ich", "ich@hhu.de", "l", "ichdude", "jap", roles);