mirror of
https://github.com/spring-projects/spring-security.git
synced 2025-07-15 23:03:32 +00:00
Polish Formatting in Tests
Issue: gh-6454
This commit is contained in:
parent
93d6a38ffd
commit
67fb936c7e
@ -93,7 +93,7 @@ public class ContentSecurityPolicyHeaderWriterTests {
|
|||||||
|
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void writeHeaderOnlyIfNotPresentContentSecurityPolicyHeader(){
|
public void writeContentSecurityPolicyHeaderWhenNotPresent() {
|
||||||
String value = new String("value");
|
String value = new String("value");
|
||||||
this.response.setHeader(CONTENT_SECURITY_POLICY_HEADER, value);
|
this.response.setHeader(CONTENT_SECURITY_POLICY_HEADER, value);
|
||||||
this.writer.writeHeaders(this.request, this.response);
|
this.writer.writeHeaders(this.request, this.response);
|
||||||
@ -101,7 +101,7 @@ public class ContentSecurityPolicyHeaderWriterTests {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void writeHeaderOnlyIfNotPresentContentSecurityPolicyReportOnlyHeader(){
|
public void writeContentSecurityPolicyReportOnlyHeaderWhenNotPresent() {
|
||||||
String value = new String("value");
|
String value = new String("value");
|
||||||
this.response.setHeader(CONTENT_SECURITY_POLICY_REPORT_ONLY_HEADER, value);
|
this.response.setHeader(CONTENT_SECURITY_POLICY_REPORT_ONLY_HEADER, value);
|
||||||
this.writer.setReportOnly(true);
|
this.writer.setReportOnly(true);
|
||||||
|
@ -15,8 +15,6 @@
|
|||||||
*/
|
*/
|
||||||
package org.springframework.security.web.header.writers;
|
package org.springframework.security.web.header.writers;
|
||||||
|
|
||||||
import static org.assertj.core.api.Assertions.assertThat;
|
|
||||||
|
|
||||||
import java.net.URI;
|
import java.net.URI;
|
||||||
import java.net.URISyntaxException;
|
import java.net.URISyntaxException;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
@ -25,9 +23,12 @@ import java.util.Map;
|
|||||||
|
|
||||||
import org.junit.Before;
|
import org.junit.Before;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
|
||||||
import org.springframework.mock.web.MockHttpServletRequest;
|
import org.springframework.mock.web.MockHttpServletRequest;
|
||||||
import org.springframework.mock.web.MockHttpServletResponse;
|
import org.springframework.mock.web.MockHttpServletResponse;
|
||||||
|
|
||||||
|
import static org.assertj.core.api.Assertions.assertThat;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Tim Ysewyn
|
* @author Tim Ysewyn
|
||||||
* @author Ankur Pathak
|
* @author Ankur Pathak
|
||||||
@ -203,7 +204,7 @@ public class HpkpHeaderWriterTests {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void writeHeaderOnlyIfNotPresentPublicKeyPins(){
|
public void writePublicKeyPinsHeaderOnlyWhenNotPresent() {
|
||||||
String value = new String("value");
|
String value = new String("value");
|
||||||
this.response.setHeader(HPKP_HEADER_NAME, value);
|
this.response.setHeader(HPKP_HEADER_NAME, value);
|
||||||
this.writer.setReportOnly(false);
|
this.writer.setReportOnly(false);
|
||||||
@ -212,7 +213,7 @@ public class HpkpHeaderWriterTests {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void writeHeaderOnlyIfNotPresentPublicKeyPinsReportOnly(){
|
public void writePublicKeyPinsReportOnlyHeaderWhenNotPresent() {
|
||||||
String value = new String("value");
|
String value = new String("value");
|
||||||
this.response.setHeader(HPKP_RO_HEADER_NAME, value);
|
this.response.setHeader(HPKP_RO_HEADER_NAME, value);
|
||||||
this.writer.setReportOnly(false);
|
this.writer.setReportOnly(false);
|
||||||
|
@ -15,14 +15,15 @@
|
|||||||
*/
|
*/
|
||||||
package org.springframework.security.web.header.writers;
|
package org.springframework.security.web.header.writers;
|
||||||
|
|
||||||
import static org.assertj.core.api.Assertions.assertThat;
|
|
||||||
|
|
||||||
import org.junit.Before;
|
import org.junit.Before;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
|
||||||
import org.springframework.mock.web.MockHttpServletRequest;
|
import org.springframework.mock.web.MockHttpServletRequest;
|
||||||
import org.springframework.mock.web.MockHttpServletResponse;
|
import org.springframework.mock.web.MockHttpServletResponse;
|
||||||
import org.springframework.security.web.util.matcher.AnyRequestMatcher;
|
import org.springframework.security.web.util.matcher.AnyRequestMatcher;
|
||||||
|
|
||||||
|
import static org.assertj.core.api.Assertions.assertThat;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Rob Winch
|
* @author Rob Winch
|
||||||
* @author Ankur Pathak
|
* @author Ankur Pathak
|
||||||
@ -154,7 +155,7 @@ public class HstsHeaderWriterTests {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void writeHeaderOnlyIfNotPresent(){
|
public void writeHeaderWhenNotPresent() {
|
||||||
String value = new String("value");
|
String value = new String("value");
|
||||||
this.response.setHeader(HSTS_HEADER_NAME, value);
|
this.response.setHeader(HSTS_HEADER_NAME, value);
|
||||||
this.writer.writeHeaders(this.request, this.response);
|
this.writer.writeHeaders(this.request, this.response);
|
||||||
|
@ -69,7 +69,7 @@ public class ReferrerPolicyHeaderWriterTests {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void writeHeaderOnlyIfNotPresent(){
|
public void writeHeaderWhenNotPresent() {
|
||||||
String value = new String("value");
|
String value = new String("value");
|
||||||
this.response.setHeader(REFERRER_POLICY_HEADER, value);
|
this.response.setHeader(REFERRER_POLICY_HEADER, value);
|
||||||
this.writer.writeHeaders(this.request, this.response);
|
this.writer.writeHeaders(this.request, this.response);
|
||||||
|
@ -15,17 +15,18 @@
|
|||||||
*/
|
*/
|
||||||
package org.springframework.security.web.header.writers;
|
package org.springframework.security.web.header.writers;
|
||||||
|
|
||||||
import static org.assertj.core.api.Assertions.assertThat;
|
|
||||||
|
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
|
|
||||||
import org.junit.Before;
|
import org.junit.Before;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
|
||||||
import org.springframework.mock.web.MockHttpServletRequest;
|
import org.springframework.mock.web.MockHttpServletRequest;
|
||||||
import org.springframework.mock.web.MockHttpServletResponse;
|
import org.springframework.mock.web.MockHttpServletResponse;
|
||||||
import org.springframework.security.web.header.Header;
|
import org.springframework.security.web.header.Header;
|
||||||
|
|
||||||
|
import static org.assertj.core.api.Assertions.assertThat;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Test for the {@code StaticHeadersWriter}
|
* Test for the {@code StaticHeadersWriter}
|
||||||
*
|
*
|
||||||
@ -98,7 +99,7 @@ public class StaticHeaderWriterTests {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void writeHeaderOnlyIfNotPresent() {
|
public void writeHeaderWhenNotPresent() {
|
||||||
String pragmaValue = new String("pragmaValue");
|
String pragmaValue = new String("pragmaValue");
|
||||||
String cacheControlValue = new String("cacheControlValue");
|
String cacheControlValue = new String("cacheControlValue");
|
||||||
this.response.setHeader("Pragma", pragmaValue);
|
this.response.setHeader("Pragma", pragmaValue);
|
||||||
|
@ -15,13 +15,14 @@
|
|||||||
*/
|
*/
|
||||||
package org.springframework.security.web.header.writers;
|
package org.springframework.security.web.header.writers;
|
||||||
|
|
||||||
import static org.assertj.core.api.Assertions.assertThat;
|
|
||||||
|
|
||||||
import org.junit.Before;
|
import org.junit.Before;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
|
||||||
import org.springframework.mock.web.MockHttpServletRequest;
|
import org.springframework.mock.web.MockHttpServletRequest;
|
||||||
import org.springframework.mock.web.MockHttpServletResponse;
|
import org.springframework.mock.web.MockHttpServletResponse;
|
||||||
|
|
||||||
|
import static org.assertj.core.api.Assertions.assertThat;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Rob Winch
|
* @author Rob Winch
|
||||||
* @author Ankur Pathak
|
* @author Ankur Pathak
|
||||||
@ -92,7 +93,7 @@ public class XXssProtectionHeaderWriterTests {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void writeHeaderOnlyIfNotPresent(){
|
public void writeHeaderWhenNotPresent() {
|
||||||
String value = new String("value");
|
String value = new String("value");
|
||||||
this.response.setHeader(XSS_PROTECTION_HEADER, value);
|
this.response.setHeader(XSS_PROTECTION_HEADER, value);
|
||||||
this.writer.writeHeaders(this.request, this.response);
|
this.writer.writeHeaders(this.request, this.response);
|
||||||
|
@ -16,18 +16,19 @@
|
|||||||
|
|
||||||
package org.springframework.security.web.header.writers.frameoptions;
|
package org.springframework.security.web.header.writers.frameoptions;
|
||||||
|
|
||||||
import org.junit.Test;
|
|
||||||
import org.springframework.mock.web.MockHttpServletRequest;
|
|
||||||
import org.springframework.mock.web.MockHttpServletResponse;
|
|
||||||
|
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
|
|
||||||
|
import org.junit.Test;
|
||||||
|
|
||||||
|
import org.springframework.mock.web.MockHttpServletRequest;
|
||||||
|
import org.springframework.mock.web.MockHttpServletResponse;
|
||||||
|
|
||||||
import static org.assertj.core.api.Assertions.assertThat;
|
import static org.assertj.core.api.Assertions.assertThat;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Rob Winch
|
* @author Rob Winch
|
||||||
* @author AnkurPathak
|
* @author Ankur Pathak
|
||||||
* @since 5.0
|
* @since 5.0
|
||||||
*/
|
*/
|
||||||
public class XFrameOptionsHeaderWriterTests {
|
public class XFrameOptionsHeaderWriterTests {
|
||||||
@ -48,7 +49,7 @@ public class XFrameOptionsHeaderWriterTests {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void writeHeaderOnlyIfNotPresent(){
|
public void writeHeaderWhenNotPresent() {
|
||||||
WhiteListedAllowFromStrategy whitelist = new WhiteListedAllowFromStrategy(Collections.singletonList("example.com"));
|
WhiteListedAllowFromStrategy whitelist = new WhiteListedAllowFromStrategy(Collections.singletonList("example.com"));
|
||||||
XFrameOptionsHeaderWriter writer = new XFrameOptionsHeaderWriter(whitelist);
|
XFrameOptionsHeaderWriter writer = new XFrameOptionsHeaderWriter(whitelist);
|
||||||
String value = new String("value");
|
String value = new String("value");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user