Skip to content

Commit 085d1f5

Browse files
Fix compile issues
1 parent d43a28d commit 085d1f5

1 file changed

Lines changed: 14 additions & 8 deletions

File tree

src/test/java/org/wise/portal/presentation/web/controllers/survey/SurveyAPIControllerTest.java

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
import org.springframework.security.authentication.TestingAuthenticationToken;
2323
import org.springframework.security.core.context.SecurityContext;
2424
import org.springframework.security.core.context.SecurityContextHolder;
25+
import org.springframework.security.core.context.SecurityContextImpl;
2526
import org.wise.portal.domain.run.Run;
2627
import org.wise.portal.domain.run.impl.RunImpl;
2728
import org.wise.portal.domain.workgroup.Workgroup;
@@ -35,20 +36,25 @@ public class SurveyAPIControllerTest {
3536
private TestingAuthenticationToken authority;
3637
private SecurityContext securityContext;
3738

38-
@TestSubject SurveyAPIController surveyAPIController = new SurveyAPIController();
39+
@TestSubject
40+
SurveyAPIController surveyAPIController = new SurveyAPIController();
3941

40-
@Mock HttpServletResponse httpServletResponse;
41-
42-
@Mock HttpServletRequest httpServletRequest;
42+
@Mock
43+
HttpServletResponse httpServletResponse;
4344

44-
@Mock RunService runService;
45+
@Mock
46+
HttpServletRequest httpServletRequest;
4547

46-
@Mock WorkgroupService workgroupService;
48+
@Mock
49+
RunService runService;
50+
51+
@Mock
52+
WorkgroupService workgroupService;
4753

4854
@BeforeEach
4955
public void setUp() {
5056
run = new RunImpl();
51-
run.setId(1);
57+
run.setId(1L);
5258
}
5359

5460
SecurityContext getSecurityContext(String role, String authorityName) {
@@ -57,6 +63,7 @@ SecurityContext getSecurityContext(String role, String authorityName) {
5763
authority.setAuthenticated(true);
5864
securityContext = new SecurityContextImpl();
5965
securityContext.setAuthentication(authority);
66+
return securityContext;
6067
}
6168

6269
@Test
@@ -124,4 +131,3 @@ public void launchSurveyRun_NoIssues_RedirectUnit() throws Exception {
124131
verify(workgroupService);
125132
}
126133
}
127-

0 commit comments

Comments
 (0)