19
19
import org .junit .Rule ;
20
20
import org .junit .Test ;
21
21
import org .junit .runner .RunWith ;
22
+
22
23
import org .springframework .beans .factory .annotation .Autowired ;
23
24
import org .springframework .security .config .annotation .web .builders .HttpSecurity ;
24
25
import org .springframework .security .config .annotation .web .configuration .EnableWebSecurity ;
32
33
import org .springframework .test .web .servlet .MockMvc ;
33
34
34
35
import static org .springframework .security .test .web .servlet .request .SecurityMockMvcRequestPostProcessors .csrf ;
36
+ import static org .springframework .security .web .header .writers .ClearSiteDataHeaderWriter .Directive .CACHE ;
37
+ import static org .springframework .security .web .header .writers .ClearSiteDataHeaderWriter .Directive .COOKIES ;
38
+ import static org .springframework .security .web .header .writers .ClearSiteDataHeaderWriter .Directive .EXECUTION_CONTEXTS ;
39
+ import static org .springframework .security .web .header .writers .ClearSiteDataHeaderWriter .Directive .STORAGE ;
35
40
import static org .springframework .test .web .servlet .request .MockMvcRequestBuilders .get ;
36
41
import static org .springframework .test .web .servlet .request .MockMvcRequestBuilders .post ;
37
42
import static org .springframework .test .web .servlet .result .MockMvcResultMatchers .header ;
@@ -50,7 +55,8 @@ public class LogoutConfigurerClearSiteDataTests {
50
55
51
56
private static final String CLEAR_SITE_DATA_HEADER = "Clear-Site-Data" ;
52
57
53
- private static final String [] SOURCE = {"cache" , "cookies" , "storage" , "executionContexts" };
58
+ private static final ClearSiteDataHeaderWriter .Directive [] SOURCE =
59
+ { CACHE , COOKIES , STORAGE , EXECUTION_CONTEXTS };
54
60
55
61
private static final String HEADER_VALUE = "\" cache\" , \" cookies\" , \" storage\" , \" executionContexts\" " ;
56
62
@@ -96,4 +102,4 @@ protected void configure(HttpSecurity http) throws Exception {
96
102
.addLogoutHandler (new HeaderWriterLogoutHandler (new ClearSiteDataHeaderWriter (SOURCE )));
97
103
}
98
104
}
99
- }
105
+ }
0 commit comments