Skip to content

Commit 1fc5b27

Browse files
committed
Update LogoutConfigurerClearSiteData Tests
Issue gh-7347
1 parent 82ae4db commit 1fc5b27

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

config/src/test/java/org/springframework/security/config/annotation/web/configurers/LogoutConfigurerClearSiteDataTests.java

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
import org.junit.Rule;
2020
import org.junit.Test;
2121
import org.junit.runner.RunWith;
22+
2223
import org.springframework.beans.factory.annotation.Autowired;
2324
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
2425
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
@@ -32,6 +33,10 @@
3233
import org.springframework.test.web.servlet.MockMvc;
3334

3435
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;
3540
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get;
3641
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.post;
3742
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.header;
@@ -50,7 +55,8 @@ public class LogoutConfigurerClearSiteDataTests {
5055

5156
private static final String CLEAR_SITE_DATA_HEADER = "Clear-Site-Data";
5257

53-
private static final String[] SOURCE = {"cache", "cookies", "storage", "executionContexts"};
58+
private static final ClearSiteDataHeaderWriter.Directive[] SOURCE =
59+
{ CACHE, COOKIES, STORAGE, EXECUTION_CONTEXTS };
5460

5561
private static final String HEADER_VALUE = "\"cache\", \"cookies\", \"storage\", \"executionContexts\"";
5662

@@ -96,4 +102,4 @@ protected void configure(HttpSecurity http) throws Exception {
96102
.addLogoutHandler(new HeaderWriterLogoutHandler(new ClearSiteDataHeaderWriter(SOURCE)));
97103
}
98104
}
99-
}
105+
}

0 commit comments

Comments
 (0)