1
+ package de .numcodex .feasibility_gui_backend .settings ;
2
+
3
+ import de .numcodex .feasibility_gui_backend .query .ratelimiting .RateLimitingInterceptor ;
4
+ import de .numcodex .feasibility_gui_backend .query .ratelimiting .RateLimitingServiceSpringConfig ;
5
+ import org .junit .jupiter .api .Tag ;
6
+ import org .junit .jupiter .api .Test ;
7
+ import org .junit .jupiter .api .extension .ExtendWith ;
8
+ import org .springframework .beans .factory .annotation .Autowired ;
9
+ import org .springframework .boot .test .autoconfigure .web .servlet .WebMvcTest ;
10
+ import org .springframework .context .annotation .Import ;
11
+ import org .springframework .security .test .context .support .WithMockUser ;
12
+ import org .springframework .test .context .bean .override .mockito .MockitoBean ;
13
+ import org .springframework .test .context .junit .jupiter .SpringExtension ;
14
+ import org .springframework .test .web .servlet .MockMvc ;
15
+
16
+ import java .net .URI ;
17
+
18
+ import static org .springframework .security .test .web .servlet .request .SecurityMockMvcRequestPostProcessors .csrf ;
19
+ import static org .springframework .test .web .servlet .request .MockMvcRequestBuilders .get ;
20
+ import static org .springframework .test .web .servlet .result .MockMvcResultMatchers .status ;
21
+
22
+ @ Tag ("info" )
23
+ @ ExtendWith (SpringExtension .class )
24
+ @ Import (RateLimitingServiceSpringConfig .class )
25
+ @ WebMvcTest (
26
+ controllers = SettingsController .class
27
+ )
28
+ class SettingsControllerIT {
29
+ @ Autowired
30
+ private MockMvc mockMvc ;
31
+
32
+ @ MockitoBean
33
+ private RateLimitingInterceptor rateLimitingInterceptor ;
34
+
35
+ @ Test
36
+ @ WithMockUser (roles = "DATAPORTAL_TEST_USER" )
37
+ void getSettings_succeeds () throws Exception {
38
+ mockMvc .perform (get (URI .create ("/.settings" )).with (csrf ()))
39
+ .andExpect (status ().isOk ());
40
+ }
41
+ }
0 commit comments