Skip to content
Snippets Groups Projects
Verified Commit 5d3c01c4 authored by Ruben Backx's avatar Ruben Backx :coffee:
Browse files

Fix tests

parent 1644dcf1
No related branches found
No related tags found
1 merge request!284Add all programmes to admin coordinator page
Pipeline #895389 waiting for manual action
......@@ -32,6 +32,7 @@ import nl.tudelft.labracore.lib.security.user.Person;
import nl.tudelft.tam.service.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Lazy;
import org.springframework.security.core.Authentication;
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.stereotype.Service;
......@@ -46,6 +47,7 @@ public class AuthorisationService {
private JobOfferService jobOfferService;
@Autowired
@Lazy
private ApplicationService applicationService;
@Autowired
......
......
......@@ -28,6 +28,8 @@ import java.util.List;
import nl.tudelft.labracore.api.ProgramControllerApi;
import nl.tudelft.labracore.api.dto.*;
import nl.tudelft.labracore.lib.security.user.DefaultRole;
import nl.tudelft.labracore.lib.security.user.Person;
import nl.tudelft.tam.cache.EditionCacheManager;
import nl.tudelft.tam.cache.PersonCacheManager;
import nl.tudelft.tam.dto.create.ApplicationCreateDTO;
......@@ -157,6 +159,8 @@ class ApplicationControllerTest {
@WithUserDetails("teacher")
void getAllApplicationsTest() throws Exception {
when(authService.isCoordinatorOfAny()).thenReturn(true);
when(authService.getAuthPerson())
.thenReturn(Person.builder().defaultRole(DefaultRole.TEACHER).build());
List<Application> appListStart = List.of(mapper.map(app1a, Application.class),
mapper.map(app3a, Application.class));
......
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment