use of org.springframework.boot.actuate.endpoint.invoke.OperationParameters in project spring-boot by spring-projects.
the class CachingOperationInvokerAdvisorTests method applyWhenTimeToLiveIsZeroShouldNotAddAdvise.
@Test
void applyWhenTimeToLiveIsZeroShouldNotAddAdvise() {
OperationParameters parameters = getParameters("get");
given(this.timeToLive.apply(any())).willReturn(0L);
OperationInvoker advised = this.advisor.apply(EndpointId.of("foo"), OperationType.READ, parameters, this.invoker);
assertThat(advised).isSameAs(this.invoker);
then(this.timeToLive).should().apply(EndpointId.of("foo"));
}
use of org.springframework.boot.actuate.endpoint.invoke.OperationParameters in project spring-boot by spring-projects.
the class CachingOperationInvokerAdvisorTests method applyWhenTimeToLiveReturnsNullShouldNotAddAdvise.
@Test
void applyWhenTimeToLiveReturnsNullShouldNotAddAdvise() {
OperationParameters parameters = getParameters("get");
given(this.timeToLive.apply(any())).willReturn(null);
OperationInvoker advised = this.advisor.apply(EndpointId.of("foo"), OperationType.READ, parameters, this.invoker);
assertThat(advised).isSameAs(this.invoker);
then(this.timeToLive).should().apply(EndpointId.of("foo"));
}
use of org.springframework.boot.actuate.endpoint.invoke.OperationParameters in project spring-boot by spring-projects.
the class CachingOperationInvokerAdvisorTests method applyWithSecurityContextShouldAddAdvise.
@Test
void applyWithSecurityContextShouldAddAdvise() {
OperationParameters parameters = getParameters("getWithSecurityContext", SecurityContext.class, String.class);
given(this.timeToLive.apply(any())).willReturn(100L);
assertAdviseIsApplied(parameters);
}
use of org.springframework.boot.actuate.endpoint.invoke.OperationParameters in project spring-boot by spring-projects.
the class CachingOperationInvokerAdvisorTests method applyWhenOperationIsNotReadShouldNotAddAdvise.
@Test
void applyWhenOperationIsNotReadShouldNotAddAdvise() {
OperationParameters parameters = getParameters("get");
OperationInvoker advised = this.advisor.apply(EndpointId.of("foo"), OperationType.WRITE, parameters, this.invoker);
assertThat(advised).isSameAs(this.invoker);
}
use of org.springframework.boot.actuate.endpoint.invoke.OperationParameters in project spring-boot by spring-projects.
the class CachingOperationInvokerAdvisorTests method applyWithAllOptionalParametersShouldAddAdvise.
@Test
void applyWithAllOptionalParametersShouldAddAdvise() {
OperationParameters parameters = getParameters("getWithAllOptionalParameters", String.class, String.class);
given(this.timeToLive.apply(any())).willReturn(100L);
assertAdviseIsApplied(parameters);
}
Aggregations