@Resource(name="PasswordEncoder")
此为按照名称进行装配[秒] [分] [时] [日] [月] [周]
scheduledtask
包,然后在该包下新建定时任务。name
必须要取,lockAtMostFor
表示加锁时间不能超过 10m,超过 10m 就释放锁,lockAtLeastFor
表示加锁至少 10m。lockAtMostFor
we make sure that the lock is released even if the node dies and by setting lockAtLeastFor
we make sure it's not executed more than once in fifteen minutes. Please note that lockAtMostFor
is just a safety net in case that the node executing the task dies, so set it to a time that is significantly larger than maximum estimated execution time. If the task takes longer than lockAtMostFor
, it may be executed again and the results will be unpredictable (more processes will hold the lock).ControllerAdvice
的注解,使用该注解表示开启了全局异常的捕获,我们只需在自定义一个方法使用ExceptionHandler
注解然后定义捕获异常的类型即可对这些捕获的异常进行统一的处理。active: @[email protected]
动态配置config/
文件夹下,增加 swagger 的配置,文件名可以任意指定,通常设置为 Swagger2Config
@JSONField(name="eMail")
。@Test
@Test
annotation, this annotation does not declare any attributes, since test extensions in JUnit Jupiter operate based on their own dedicated annotations. Such methods are inherited unless they are overridden.@ParameterizedTest
@RepeatedTest
@TestFactory
@TestTemplate
@TestMethodOrder
@FixMethodOrder
. Such annotations are inherited.@TestInstance
@DisplayName
@DisplayNameGeneration
@BeforeEach
@Test
, @RepeatedTest
, @ParameterizedTest
, or @TestFactory
method in the current class; analogous to JUnit 4’s @Before
. Such methods are inherited unless they are overridden.@AfterEach
@Test
, @RepeatedTest
, @ParameterizedTest
, or @TestFactory
method in the current class; analogous to JUnit 4’s @After
. Such methods are inherited unless they are overridden.@BeforeAll
@Test
, @RepeatedTest
, @ParameterizedTest
, and @TestFactory
methods in the current class; analogous to JUnit 4’s @BeforeClass
. Such methods are inherited (unless they are hidden or overridden) and must be static
(unless the "per-class" test instance lifecycle is used).@AfterAll
@Test
, @RepeatedTest
, @ParameterizedTest
, and @TestFactory
methods in the current class; analogous to JUnit 4’s @AfterClass
. Such methods are inherited (unless they are hidden or overridden) and must be static
(unless the "per-class" test instance lifecycle is used).@Nested
@BeforeAll
and @AfterAll
methods cannot be used directly in a @Nested
test class unless the "per-class" test instance lifecycle is used. Such annotations are not inherited.@Tag
@Disabled
@Ignore
. Such annotations are not inherited.@Timeout
@ExtendWith
@RegisterExtension
@TempDir
org.junit.jupiter.api.io
package.@Transactional
进行回滚