Polishing
This commit is contained in:
parent
695559879e
commit
fff50657d2
|
|
@ -54,7 +54,7 @@ class EnableCachingIntegrationTests {
|
||||||
|
|
||||||
|
|
||||||
@AfterEach
|
@AfterEach
|
||||||
public void closeContext() {
|
void closeContext() {
|
||||||
if (this.context != null) {
|
if (this.context != null) {
|
||||||
this.context.close();
|
this.context.close();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -60,6 +60,7 @@ class CacheErrorHandlerTests {
|
||||||
|
|
||||||
private SimpleService simpleService;
|
private SimpleService simpleService;
|
||||||
|
|
||||||
|
|
||||||
@BeforeEach
|
@BeforeEach
|
||||||
void setup() {
|
void setup() {
|
||||||
this.context = new AnnotationConfigApplicationContext(Config.class);
|
this.context = new AnnotationConfigApplicationContext(Config.class);
|
||||||
|
|
@ -69,11 +70,13 @@ class CacheErrorHandlerTests {
|
||||||
this.simpleService = context.getBean(SimpleService.class);
|
this.simpleService = context.getBean(SimpleService.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@AfterEach
|
@AfterEach
|
||||||
void tearDown() {
|
void closeContext() {
|
||||||
this.context.close();
|
this.context.close();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
void getFail() {
|
void getFail() {
|
||||||
UnsupportedOperationException exception = new UnsupportedOperationException("Test exception on get");
|
UnsupportedOperationException exception = new UnsupportedOperationException("Test exception on get");
|
||||||
|
|
@ -107,9 +110,9 @@ class CacheErrorHandlerTests {
|
||||||
|
|
||||||
this.cacheInterceptor.setErrorHandler(new SimpleCacheErrorHandler());
|
this.cacheInterceptor.setErrorHandler(new SimpleCacheErrorHandler());
|
||||||
|
|
||||||
assertThatExceptionOfType(UnsupportedOperationException.class).isThrownBy(() ->
|
assertThatExceptionOfType(UnsupportedOperationException.class)
|
||||||
this.simpleService.get(0L))
|
.isThrownBy(() -> this.simpleService.get(0L))
|
||||||
.withMessage("Test exception on get");
|
.withMessage("Test exception on get");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
|
@ -128,9 +131,9 @@ class CacheErrorHandlerTests {
|
||||||
|
|
||||||
this.cacheInterceptor.setErrorHandler(new SimpleCacheErrorHandler());
|
this.cacheInterceptor.setErrorHandler(new SimpleCacheErrorHandler());
|
||||||
|
|
||||||
assertThatExceptionOfType(UnsupportedOperationException.class).isThrownBy(() ->
|
assertThatExceptionOfType(UnsupportedOperationException.class)
|
||||||
this.simpleService.put(0L))
|
.isThrownBy(() -> this.simpleService.put(0L))
|
||||||
.withMessage("Test exception on put");
|
.withMessage("Test exception on put");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
|
@ -149,9 +152,9 @@ class CacheErrorHandlerTests {
|
||||||
|
|
||||||
this.cacheInterceptor.setErrorHandler(new SimpleCacheErrorHandler());
|
this.cacheInterceptor.setErrorHandler(new SimpleCacheErrorHandler());
|
||||||
|
|
||||||
assertThatExceptionOfType(UnsupportedOperationException.class).isThrownBy(() ->
|
assertThatExceptionOfType(UnsupportedOperationException.class)
|
||||||
this.simpleService.evict(0L))
|
.isThrownBy(() -> this.simpleService.evict(0L))
|
||||||
.withMessage("Test exception on evict");
|
.withMessage("Test exception on evict");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
|
@ -170,9 +173,9 @@ class CacheErrorHandlerTests {
|
||||||
|
|
||||||
this.cacheInterceptor.setErrorHandler(new SimpleCacheErrorHandler());
|
this.cacheInterceptor.setErrorHandler(new SimpleCacheErrorHandler());
|
||||||
|
|
||||||
assertThatExceptionOfType(UnsupportedOperationException.class).isThrownBy(() ->
|
assertThatExceptionOfType(UnsupportedOperationException.class)
|
||||||
this.simpleService.clear())
|
.isThrownBy(() -> this.simpleService.clear())
|
||||||
.withMessage("Test exception on clear");
|
.withMessage("Test exception on clear");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2002-2021 the original author or authors.
|
* Copyright 2002-2023 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
|
@ -51,6 +51,7 @@ public class CachePutEvaluationTests {
|
||||||
|
|
||||||
private SimpleService service;
|
private SimpleService service;
|
||||||
|
|
||||||
|
|
||||||
@BeforeEach
|
@BeforeEach
|
||||||
public void setup() {
|
public void setup() {
|
||||||
this.context = new AnnotationConfigApplicationContext(Config.class);
|
this.context = new AnnotationConfigApplicationContext(Config.class);
|
||||||
|
|
@ -59,12 +60,11 @@ public class CachePutEvaluationTests {
|
||||||
}
|
}
|
||||||
|
|
||||||
@AfterEach
|
@AfterEach
|
||||||
public void close() {
|
public void closeContext() {
|
||||||
if (this.context != null) {
|
this.context.close();
|
||||||
this.context.close();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void mutualGetPutExclusion() {
|
public void mutualGetPutExclusion() {
|
||||||
String key = "1";
|
String key = "1";
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2002-2022 the original author or authors.
|
* Copyright 2002-2023 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
|
@ -72,7 +72,7 @@ class CacheResolverCustomizationTests {
|
||||||
}
|
}
|
||||||
|
|
||||||
@AfterEach
|
@AfterEach
|
||||||
void tearDown() {
|
void closeContext() {
|
||||||
this.context.close();
|
this.context.close();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -142,16 +142,17 @@ class CacheResolverCustomizationTests {
|
||||||
@Test
|
@Test
|
||||||
void noCacheResolved() {
|
void noCacheResolved() {
|
||||||
Method method = ReflectionUtils.findMethod(SimpleService.class, "noCacheResolved", Object.class);
|
Method method = ReflectionUtils.findMethod(SimpleService.class, "noCacheResolved", Object.class);
|
||||||
assertThatIllegalStateException().isThrownBy(() ->
|
|
||||||
this.simpleService.noCacheResolved(new Object()))
|
assertThatIllegalStateException()
|
||||||
.withMessageContaining(method.toString());
|
.isThrownBy(() -> this.simpleService.noCacheResolved(new Object()))
|
||||||
|
.withMessageContaining(method.toString());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
void unknownCacheResolver() {
|
void unknownCacheResolver() {
|
||||||
assertThatExceptionOfType(NoSuchBeanDefinitionException.class).isThrownBy(() ->
|
assertThatExceptionOfType(NoSuchBeanDefinitionException.class)
|
||||||
this.simpleService.unknownCacheResolver(new Object()))
|
.isThrownBy(() -> this.simpleService.unknownCacheResolver(new Object()))
|
||||||
.satisfies(ex -> assertThat(ex.getBeanName()).isEqualTo("unknownCacheResolver"));
|
.satisfies(ex -> assertThat(ex.getBeanName()).isEqualTo("unknownCacheResolver"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1350,12 +1350,12 @@
|
||||||
set on the "Access-Control-Allow-Credentials" response header of
|
set on the "Access-Control-Allow-Credentials" response header of
|
||||||
preflight requests.
|
preflight requests.
|
||||||
|
|
||||||
NOTE: Be aware that this option establishes a high
|
NOTE: Be aware that this option establishes a high level of trust with
|
||||||
level of trust with the configured domains and also increases the surface
|
the configured domains and also increases the surface attack of the web
|
||||||
attack of the web application by exposing sensitive user-specific
|
application by exposing sensitive user-specific information such as
|
||||||
information such as cookies and CSRF tokens.
|
cookies and CSRF tokens.
|
||||||
|
|
||||||
By default this is not set in which case the
|
By default, this is not set in which case the
|
||||||
"Access-Control-Allow-Credentials" header is also not set and
|
"Access-Control-Allow-Credentials" header is also not set and
|
||||||
credentials are therefore not allowed.
|
credentials are therefore not allowed.
|
||||||
]]></xsd:documentation>
|
]]></xsd:documentation>
|
||||||
|
|
|
||||||
|
|
@ -420,7 +420,7 @@
|
||||||
<xsd:annotation>
|
<xsd:annotation>
|
||||||
<xsd:documentation source="java:org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor"><![CDATA[
|
<xsd:documentation source="java:org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor"><![CDATA[
|
||||||
Set the core pool size of the ThreadPoolExecutor.
|
Set the core pool size of the ThreadPoolExecutor.
|
||||||
NOTE: the core pool size is effectively the max pool size when an unbounded queue-capacity is configured (the default).
|
NOTE: The core pool size is effectively the max pool size when an unbounded queue-capacity is configured (the default).
|
||||||
This is essentially the "Unbounded queues" strategy as explained in java.util.concurrent.ThreadPoolExecutor.
|
This is essentially the "Unbounded queues" strategy as explained in java.util.concurrent.ThreadPoolExecutor.
|
||||||
When this strategy is used, the max pool size is effectively ignored.
|
When this strategy is used, the max pool size is effectively ignored.
|
||||||
By default this is set to twice the value of Runtime.availableProcessors().
|
By default this is set to twice the value of Runtime.availableProcessors().
|
||||||
|
|
@ -433,7 +433,7 @@
|
||||||
<xsd:annotation>
|
<xsd:annotation>
|
||||||
<xsd:documentation source="java:org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor"><![CDATA[
|
<xsd:documentation source="java:org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor"><![CDATA[
|
||||||
Set the max pool size of the ThreadPoolExecutor.
|
Set the max pool size of the ThreadPoolExecutor.
|
||||||
NOTE: when an unbounded queue-capacity is configured (the default), the max pool size is effectively ignored.
|
NOTE: When an unbounded queue-capacity is configured (the default), the max pool size is effectively ignored.
|
||||||
See the "Unbounded queues" strategy in java.util.concurrent.ThreadPoolExecutor for more details.
|
See the "Unbounded queues" strategy in java.util.concurrent.ThreadPoolExecutor for more details.
|
||||||
By default this is set to Integer.MAX_VALUE.
|
By default this is set to Integer.MAX_VALUE.
|
||||||
]]></xsd:documentation>
|
]]></xsd:documentation>
|
||||||
|
|
@ -453,7 +453,7 @@
|
||||||
<xsd:annotation>
|
<xsd:annotation>
|
||||||
<xsd:documentation source="java:org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor"><![CDATA[
|
<xsd:documentation source="java:org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor"><![CDATA[
|
||||||
Set the queue capacity for the ThreadPoolExecutor.
|
Set the queue capacity for the ThreadPoolExecutor.
|
||||||
NOTE: when an unbounded queue-capacity is configured (the default) the core pool size is effectively the max pool size.
|
NOTE: When an unbounded queue-capacity is configured (the default) the core pool size is effectively the max pool size.
|
||||||
This is essentially the "Unbounded queues" strategy as explained in java.util.concurrent.ThreadPoolExecutor.
|
This is essentially the "Unbounded queues" strategy as explained in java.util.concurrent.ThreadPoolExecutor.
|
||||||
When this strategy is used, the max pool size is effectively ignored.
|
When this strategy is used, the max pool size is effectively ignored.
|
||||||
By default this is set to Integer.MAX_VALUE.
|
By default this is set to Integer.MAX_VALUE.
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue