See gh-44148

Signed-off-by: Johnny Lim <izeye@naver.com>
This commit is contained in:
Johnny Lim 2025-02-07 00:15:25 +09:00 committed by Moritz Halbritter
parent 1e73a7cf8b
commit c335f772d0
11 changed files with 28 additions and 17 deletions

View File

@ -176,7 +176,7 @@ include::partial$rest/actuator/quartz/trigger-job/http-response.adoc[]
=== Request Structure
The request specifies a desired `state` associated with a particular job.
Sending an HTTP Request with a `"state": "running"` body indicates that the job should be run now.
Sending an HTTP request with a `"state": "running"` body indicates that the job should be run now.
The following table describes the structure of the request:
[cols="2,1,3"]

View File

@ -64,7 +64,7 @@
},
{
"name": "management.endpoints.access.max-permitted",
"description": "The maximum level of endpoint access that is permitted. Caps an endpoint's individual access level (management.endpoint.<id>.access) and the default access (management.endpoints.access.default).'",
"description": "Maximum level of endpoint access that is permitted. Caps an endpoint's individual access level (management.endpoint.<id>.access) and the default access (management.endpoints.access.default).'",
"defaultValue": "unrestricted"
},
{
@ -2107,7 +2107,7 @@
},
{
"name": "management.server.ssl.bundle",
"description": "The name of a configured SSL bundle."
"description": "Name of a configured SSL bundle."
},
{
"name": "management.server.ssl.certificate",

View File

@ -409,7 +409,9 @@ public class QuartzEndpoint {
}
/**
* Description of a triggered on demand {@link Job Quartz Job}.
* Description of a triggered on-demand {@link Job Quartz Job}.
*
* @since 3.5.0
*/
public static final class QuartzJobTriggerDescriptor {

View File

@ -80,6 +80,16 @@ public class QuartzEndpointWebExtension {
() -> this.delegate.quartzTrigger(group, name, showUnsanitized));
}
/**
* Trigger a Quartz job.
* @param jobs path segment "jobs"
* @param group job's group
* @param name job name
* @param state desired state
* @return web endpoint response
* @throws SchedulerException if there is an error triggering the job
* @since 3.5.0
*/
@WriteOperation
public WebEndpointResponse<Object> triggerQuartzJob(@Selector String jobs, @Selector String group,
@Selector String name, String state) throws SchedulerException {

View File

@ -778,7 +778,7 @@ class QuartzEndpointTests {
}
@Test
void quartzJobShouldNotBeTriggeredJobDoesNotExist() throws SchedulerException {
void quartzJobShouldNotBeTriggeredWhenJobDoesNotExist() throws SchedulerException {
QuartzJobTriggerDescriptor quartzJobTriggerDescriptor = this.endpoint.triggerQuartzJob("samples", "hello");
assertThat(quartzJobTriggerDescriptor).isNull();
then(this.scheduler).should(never()).triggerJob(any());

View File

@ -26,7 +26,7 @@ import org.springframework.context.annotation.Conditional;
/**
* Container annotation that aggregates several
* {@link ConditionalOnProperty @ConditionalOnProperty} annotations.
* {@link ConditionalOnBooleanProperty @ConditionalOnBooleanProperty} annotations.
*
* @author Phillip Webb
* @since 3.5.0

View File

@ -89,8 +89,8 @@ class OnPropertyCondition extends SpringBootCondition {
}
private Stream<MergedAnnotation<Annotation>> stream(MergedAnnotations annotations,
Class<? extends Annotation> containerType) {
return annotations.stream(containerType.getName())
Class<? extends Annotation> type) {
return annotations.stream(type.getName())
.filter(MergedAnnotationPredicates.unique(MergedAnnotation::getMetaTypes));
}

View File

@ -269,7 +269,7 @@
},
{
"name": "server.ssl.bundle",
"description": "The name of a configured SSL bundle."
"description": "Name of a configured SSL bundle."
},
{
"name": "server.ssl.certificate",
@ -2606,7 +2606,7 @@
},
{
"name": "spring.rsocket.server.ssl.bundle",
"description": "The name of a configured SSL bundle."
"description": "Name of a configured SSL bundle."
},
{
"name": "spring.rsocket.server.ssl.certificate",

View File

@ -35,7 +35,6 @@ import org.assertj.core.api.InstanceOfAssertFactories;
import org.assertj.core.api.InstanceOfAssertFactory;
import org.assertj.core.api.ObjectAssert;
import org.junit.jupiter.api.Test;
import reactor.core.publisher.Mono;
import org.springframework.beans.factory.BeanCreationException;
import org.springframework.boot.autoconfigure.AutoConfigurations;
@ -48,7 +47,6 @@ import org.springframework.boot.test.context.runner.ApplicationContextRunner;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.r2dbc.core.DatabaseClient;
import org.springframework.test.util.ReflectionTestUtils;
import static org.assertj.core.api.Assertions.assertThat;
@ -98,9 +96,10 @@ class R2dbcAutoConfigurationTests {
assertThat(poolMetrics.getMaxAllocatedSize()).isEqualTo(15);
assertThat(connectionPool).hasFieldOrPropertyWithValue("maxAcquireTime", Duration.ofMinutes(3));
assertThat(connectionPool).hasFieldOrPropertyWithValue("maxValidationTime", Duration.ofSeconds(1));
Mono<?> create = (Mono<?>) ReflectionTestUtils.getField(connectionPool, "create");
assertThat(create.getClass().getName()).endsWith("MonoRetry");
assertThat(create).hasFieldOrPropertyWithValue("times", 5L);
assertThat(connectionPool).extracting("create").satisfies((mono) -> {
assertThat(mono.getClass().getName()).endsWith("MonoRetry");
assertThat(mono).hasFieldOrPropertyWithValue("times", 5L);
});
}
finally {
connectionPool.close().block();

View File

@ -642,7 +642,7 @@ logging:
----
TIP: For more advanced customizations, you can use the javadoc:org.springframework.boot.logging.structured.StructuredLoggingJsonMembersCustomizer[] interface.
You can reference a one or more implementations using the configprop:logging.structured.json.customizer[] property.
You can reference one or more implementations using the configprop:logging.structured.json.customizer[] property.
You can also declare implementations by listing them in a `META-INF/spring.factories` file.

View File

@ -34,7 +34,7 @@ import static org.mockito.Mockito.mock;
class FixedTrustManagerFactoryTests {
@Test
void shouldReturnTrustmanagers() throws Exception {
void shouldReturnTrustManagers() throws Exception {
TrustManager trustManager1 = mock(TrustManager.class);
TrustManager trustManager2 = mock(TrustManager.class);
FixedTrustManagerFactory factory = FixedTrustManagerFactory.of(getDefaultTrustManagerFactory(), trustManager1,