|
|
|
@ -386,10 +386,16 @@ public class HttpHeadersConfigTests { |
|
|
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
@Test |
|
|
|
public void configureWhenXssProtectionDisabledAndBlockSetThenAutowireFails() { |
|
|
|
public void configureWhenXssProtectionDisabledAndBlockSetThenAutowireFails() { |
|
|
|
|
|
|
|
/* |
|
|
|
|
|
|
|
* NOTE: Original error message "Cannot set block to true with enabled false" no |
|
|
|
|
|
|
|
* longer shows up in stack trace as of Spring Framework 6.x. |
|
|
|
|
|
|
|
* |
|
|
|
|
|
|
|
* See https://github.com/spring-projects/spring-framework/issues/25162.
|
|
|
|
|
|
|
|
*/ |
|
|
|
assertThatExceptionOfType(BeanCreationException.class) |
|
|
|
assertThatExceptionOfType(BeanCreationException.class) |
|
|
|
.isThrownBy(() -> this.spring |
|
|
|
.isThrownBy(() -> this.spring |
|
|
|
.configLocations(this.xml("DefaultsDisabledWithXssProtectionDisabledAndBlockSet")).autowire()) |
|
|
|
.configLocations(this.xml("DefaultsDisabledWithXssProtectionDisabledAndBlockSet")).autowire()) |
|
|
|
.withMessageContaining("Cannot set block to true with enabled false"); |
|
|
|
.havingRootCause().withMessageContaining("Property 'block' threw exception"); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
@Test |
|
|
|
@ -445,14 +451,14 @@ public class HttpHeadersConfigTests { |
|
|
|
public void configureWhenUsingHpkpWithoutPinsThenAutowireFails() { |
|
|
|
public void configureWhenUsingHpkpWithoutPinsThenAutowireFails() { |
|
|
|
assertThatExceptionOfType(XmlBeanDefinitionStoreException.class) |
|
|
|
assertThatExceptionOfType(XmlBeanDefinitionStoreException.class) |
|
|
|
.isThrownBy(() -> this.spring.configLocations(this.xml("DefaultsDisabledWithEmptyHpkp")).autowire()) |
|
|
|
.isThrownBy(() -> this.spring.configLocations(this.xml("DefaultsDisabledWithEmptyHpkp")).autowire()) |
|
|
|
.withMessageContaining("The content of element 'hpkp' is not complete"); |
|
|
|
.havingRootCause().withMessageContaining("The content of element 'hpkp' is not complete"); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
@Test |
|
|
|
public void configureWhenUsingHpkpWithEmptyPinsThenAutowireFails() { |
|
|
|
public void configureWhenUsingHpkpWithEmptyPinsThenAutowireFails() { |
|
|
|
assertThatExceptionOfType(XmlBeanDefinitionStoreException.class) |
|
|
|
assertThatExceptionOfType(XmlBeanDefinitionStoreException.class) |
|
|
|
.isThrownBy(() -> this.spring.configLocations(this.xml("DefaultsDisabledWithEmptyPins")).autowire()) |
|
|
|
.isThrownBy(() -> this.spring.configLocations(this.xml("DefaultsDisabledWithEmptyPins")).autowire()) |
|
|
|
.withMessageContaining("The content of element 'pins' is not complete"); |
|
|
|
.havingRootCause().withMessageContaining("The content of element 'pins' is not complete"); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
@Test |
|
|
|
|