Polish
This commit is contained in:
@@ -648,16 +648,14 @@ class ReactiveOAuth2ResourceServerAutoConfigurationTests {
|
||||
}
|
||||
|
||||
static Jwt.Builder jwt() {
|
||||
// @formatter:off
|
||||
return Jwt.withTokenValue("token")
|
||||
.header("alg", "none")
|
||||
.expiresAt(Instant.MAX)
|
||||
.issuedAt(Instant.MIN)
|
||||
.issuer("https://issuer.example.org")
|
||||
.jti("jti")
|
||||
.notBefore(Instant.MIN)
|
||||
.subject("mock-test-subject");
|
||||
// @formatter:on
|
||||
.header("alg", "none")
|
||||
.expiresAt(Instant.MAX)
|
||||
.issuedAt(Instant.MIN)
|
||||
.issuer("https://issuer.example.org")
|
||||
.jti("jti")
|
||||
.notBefore(Instant.MIN)
|
||||
.subject("mock-test-subject");
|
||||
}
|
||||
|
||||
@EnableWebFluxSecurity
|
||||
|
||||
@@ -664,16 +664,14 @@ class OAuth2ResourceServerAutoConfigurationTests {
|
||||
}
|
||||
|
||||
static Jwt.Builder jwt() {
|
||||
// @formatter:off
|
||||
return Jwt.withTokenValue("token")
|
||||
.header("alg", "none")
|
||||
.expiresAt(Instant.MAX)
|
||||
.issuedAt(Instant.MIN)
|
||||
.issuer("https://issuer.example.org")
|
||||
.jti("jti")
|
||||
.notBefore(Instant.MIN)
|
||||
.subject("mock-test-subject");
|
||||
// @formatter:on
|
||||
.header("alg", "none")
|
||||
.expiresAt(Instant.MAX)
|
||||
.issuedAt(Instant.MIN)
|
||||
.issuer("https://issuer.example.org")
|
||||
.jti("jti")
|
||||
.notBefore(Instant.MIN)
|
||||
.subject("mock-test-subject");
|
||||
}
|
||||
|
||||
@Configuration(proxyBeanMethods = false)
|
||||
|
||||
@@ -31,14 +31,12 @@ public class MyCustomObservation {
|
||||
}
|
||||
|
||||
public void doSomething() {
|
||||
// @formatter:off
|
||||
Observation.createNotStarted("doSomething", this.observationRegistry)
|
||||
.lowCardinalityKeyValue("locale", "en-US")
|
||||
.highCardinalityKeyValue("userId", "42")
|
||||
.observe(() -> {
|
||||
// Execute business logic here
|
||||
});
|
||||
// @formatter:on
|
||||
.lowCardinalityKeyValue("locale", "en-US")
|
||||
.highCardinalityKeyValue("userId", "42")
|
||||
.observe(() -> {
|
||||
// Execute business logic here
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -36,11 +36,9 @@ public class MyBean {
|
||||
|
||||
// tag::method[]
|
||||
public List<GregorianCalendar> authorsBornAfter1980() {
|
||||
// @formatter:off
|
||||
return this.create.selectFrom(AUTHOR)
|
||||
.where(AUTHOR.DATE_OF_BIRTH.greaterThan(new GregorianCalendar(1980, 0, 1)))
|
||||
.fetch(AUTHOR.DATE_OF_BIRTH);
|
||||
// @formatter:on
|
||||
.where(AUTHOR.DATE_OF_BIRTH.greaterThan(new GregorianCalendar(1980, 0, 1)))
|
||||
.fetch(AUTHOR.DATE_OF_BIRTH);
|
||||
} // end::method[]
|
||||
|
||||
}
|
||||
|
||||
@@ -26,13 +26,11 @@ class MyConditionEvaluationReportingTests {
|
||||
|
||||
@Test
|
||||
void autoConfigTest() {
|
||||
// @formatter:off
|
||||
new ApplicationContextRunner()
|
||||
.withInitializer(ConditionEvaluationReportLoggingListener.forLogLevel(LogLevel.INFO))
|
||||
.run((context) -> {
|
||||
// Test something...
|
||||
// Test something...
|
||||
});
|
||||
// @formatter:on
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -22,15 +22,12 @@ import org.springframework.boot.builder.SpringApplicationBuilder;
|
||||
public class MyApplication {
|
||||
|
||||
public void hierarchyWithDisabledBanner(String[] args) {
|
||||
// @formatter:off
|
||||
// tag::code[]
|
||||
new SpringApplicationBuilder()
|
||||
.sources(Parent.class)
|
||||
.child(Application.class)
|
||||
.bannerMode(Banner.Mode.OFF)
|
||||
.run(args);
|
||||
new SpringApplicationBuilder().sources(Parent.class)
|
||||
.child(Application.class)
|
||||
.bannerMode(Banner.Mode.OFF)
|
||||
.run(args);
|
||||
// end::code[]
|
||||
// @formatter:on
|
||||
}
|
||||
|
||||
static class Parent {
|
||||
|
||||
@@ -37,11 +37,9 @@ class MyUserDocumentationTests {
|
||||
|
||||
@Test
|
||||
void listUsers() throws Exception {
|
||||
// @formatter:off
|
||||
this.mvc.perform(get("/users").accept(MediaType.TEXT_PLAIN))
|
||||
.andExpect(status().isOk())
|
||||
.andDo(document("list-users"));
|
||||
// @formatter:on
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user