Search in sources :

Example 6 with OperationParameters

use of org.springframework.boot.actuate.endpoint.invoke.OperationParameters in project spring-boot by spring-projects.

the class CachingOperationInvokerAdvisorTests method applyWhenHasAtLeaseOneMandatoryParameterShouldNotAddAdvise.

@Test
void applyWhenHasAtLeaseOneMandatoryParameterShouldNotAddAdvise() {
    OperationParameters parameters = getParameters("getWithParameters", String.class, String.class);
    OperationInvoker advised = this.advisor.apply(EndpointId.of("foo"), OperationType.READ, parameters, this.invoker);
    assertThat(advised).isSameAs(this.invoker);
}
Also used : OperationParameters(org.springframework.boot.actuate.endpoint.invoke.OperationParameters) OperationInvoker(org.springframework.boot.actuate.endpoint.invoke.OperationInvoker) Test(org.junit.jupiter.api.Test)

Example 7 with OperationParameters

use of org.springframework.boot.actuate.endpoint.invoke.OperationParameters in project spring-boot by spring-projects.

the class CachingOperationInvokerAdvisorTests method applyWithMandatoryCachedAndNonCachedShouldAddAdvise.

@Test
void applyWithMandatoryCachedAndNonCachedShouldAddAdvise() {
    OperationParameters parameters = getParameters("getWithServerNamespaceAndOtherMandatory", WebServerNamespace.class, String.class);
    OperationInvoker advised = this.advisor.apply(EndpointId.of("foo"), OperationType.READ, parameters, this.invoker);
    assertThat(advised).isSameAs(this.invoker);
}
Also used : OperationParameters(org.springframework.boot.actuate.endpoint.invoke.OperationParameters) OperationInvoker(org.springframework.boot.actuate.endpoint.invoke.OperationInvoker) Test(org.junit.jupiter.api.Test)

Example 8 with OperationParameters

use of org.springframework.boot.actuate.endpoint.invoke.OperationParameters in project spring-boot by spring-projects.

the class CachingOperationInvokerAdvisorTests method applyWithApiVersionShouldAddAdvise.

@Test
void applyWithApiVersionShouldAddAdvise() {
    OperationParameters parameters = getParameters("getWithApiVersion", ApiVersion.class, String.class);
    given(this.timeToLive.apply(any())).willReturn(100L);
    assertAdviseIsApplied(parameters);
}
Also used : OperationParameters(org.springframework.boot.actuate.endpoint.invoke.OperationParameters) Test(org.junit.jupiter.api.Test)

Example 9 with OperationParameters

use of org.springframework.boot.actuate.endpoint.invoke.OperationParameters in project spring-boot by spring-projects.

the class CachingOperationInvokerAdvisorTests method applyShouldAddCacheAdvise.

@Test
void applyShouldAddCacheAdvise() {
    OperationParameters parameters = getParameters("get");
    given(this.timeToLive.apply(any())).willReturn(100L);
    assertAdviseIsApplied(parameters);
}
Also used : OperationParameters(org.springframework.boot.actuate.endpoint.invoke.OperationParameters) Test(org.junit.jupiter.api.Test)

Example 10 with OperationParameters

use of org.springframework.boot.actuate.endpoint.invoke.OperationParameters in project spring-boot by spring-projects.

the class CachingOperationInvokerAdvisorTests method applyWithWebServerNamespaceShouldAddAdvise.

@Test
void applyWithWebServerNamespaceShouldAddAdvise() {
    OperationParameters parameters = getParameters("getWithServerNamespace", WebServerNamespace.class, String.class);
    given(this.timeToLive.apply(any())).willReturn(100L);
    assertAdviseIsApplied(parameters);
}
Also used : OperationParameters(org.springframework.boot.actuate.endpoint.invoke.OperationParameters) Test(org.junit.jupiter.api.Test)

Aggregations

Test (org.junit.jupiter.api.Test)11 OperationParameters (org.springframework.boot.actuate.endpoint.invoke.OperationParameters)11 OperationInvoker (org.springframework.boot.actuate.endpoint.invoke.OperationInvoker)5