diff --git a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/actuator/cloud-foundry.adoc b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/actuator/cloud-foundry.adoc index 5bffa1be03..0be451b9a7 100644 --- a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/actuator/cloud-foundry.adoc +++ b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/actuator/cloud-foundry.adoc @@ -52,5 +52,5 @@ For Tomcat, the following configuration can be added: [source,java,indent=0] ---- -include::{docs-java}/actuator/cloudfoundry/customcontextpath/CloudFoundryCustomContextPathConfiguration.java[] +include::{docs-java}/actuator/cloudfoundry/customcontextpath/MyCloudFoundryConfiguration.java[] ---- diff --git a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/actuator/endpoints.adoc b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/actuator/endpoints.adoc index dfa44f1075..87c55537f0 100644 --- a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/actuator/endpoints.adoc +++ b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/actuator/endpoints.adoc @@ -426,7 +426,7 @@ The following example exposes a read operation that returns a custom object: [source,java,indent=0] ---- -include::{docs-java}/actuator/endpoints/implementingcustom/CustomEndpoint.java[tag=read] +include::{docs-java}/actuator/endpoints/implementingcustom/MyEndpoint.java[tag=read] ---- You can also write technology-specific endpoints by using `@JmxEndpoint` or `@WebEndpoint`. @@ -463,7 +463,7 @@ This can be used to invoke a write operation that takes `String name` and `int c [source,java,indent=0] ---- -include::{docs-java}/actuator/endpoints/implementingcustom/CustomEndpoint.java[tag=write] +include::{docs-java}/actuator/endpoints/implementingcustom/MyEndpoint.java[tag=write] ---- TIP: Because endpoints are technology agnostic, only simple types can be specified in the method signature. diff --git a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/actuator/metrics.adoc b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/actuator/metrics.adoc index c2ee67c525..508e54b088 100644 --- a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/actuator/metrics.adoc +++ b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/actuator/metrics.adoc @@ -886,7 +886,7 @@ To replace the default metric tags, define a `MongoCommandTagsProvider` bean, as [source,java,indent=0] ---- -include::{docs-java}/actuator/metrics/supported/mongodb/command/SampleCommandTagsProviderConfiguration.java[] +include::{docs-java}/actuator/metrics/supported/mongodb/command/MyCommandTagsProviderConfiguration.java[] ---- To disable the auto-configured command metrics, set the following property: @@ -927,7 +927,7 @@ To replace the default metric tags, define a `MongoConnectionPoolTagsProvider` b [source,java,indent=0] ---- -include::{docs-java}/actuator/metrics/supported/mongodb/connectionpool/SampleConnectionPoolTagsProviderConfiguration.java[] +include::{docs-java}/actuator/metrics/supported/mongodb/connectionpool/MyConnectionPoolTagsProviderConfiguration.java[] ---- To disable the auto-configured connection pool metrics, set the following property: @@ -980,14 +980,14 @@ To register custom metrics, inject `MeterRegistry` into your component, as shown [source,java,indent=0] ---- -include::{docs-java}/actuator/metrics/registeringcustom/MetricsMeterRegistryInjection.java[] +include::{docs-java}/actuator/metrics/registeringcustom/MyBean.java[] ---- If your metrics depend on other beans, it is recommended that you use a `MeterBinder` to register them, as shown in the following example: [source,java,indent=0] ---- -include::{docs-java}/actuator/metrics/registeringcustom/SampleMeterBinderConfiguration.java[] +include::{docs-java}/actuator/metrics/registeringcustom/MyMeterBinderConfiguration.java[] ---- Using a `MeterBinder` ensures that the correct dependency relationships are set up and that the bean is available when the metric's value is retrieved. @@ -1005,7 +1005,7 @@ For example, if you want to rename the `mytag.region` tag to `mytag.area` for al [source,java,indent=0] ---- -include::{docs-java}/actuator/metrics/customizing/MetricsFilterConfiguration.java[] +include::{docs-java}/actuator/metrics/customizing/MyMetricsFilterConfiguration.java[] ---- NOTE: By default, all `MeterFilter` beans will be automatically bound to the Spring-managed `MeterRegistry`. diff --git a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/configuration-metadata/annotation-processor.adoc b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/configuration-metadata/annotation-processor.adoc index 0db8757023..d18069ddb4 100644 --- a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/configuration-metadata/annotation-processor.adoc +++ b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/configuration-metadata/annotation-processor.adoc @@ -71,11 +71,11 @@ Consider the following example: [source,java,indent=0,subs="verbatim,attributes"] ---- -include::{docs-java}/configurationmetadata/annotationprocessor/automaticmetadatageneration/ServerProperties.java[] +include::{docs-java}/configurationmetadata/annotationprocessor/automaticmetadatageneration/MyServerProperties.java[] ---- -This exposes three properties where `server.name` has no default and `server.ip` and `server.port` defaults to `"127.0.0.1"` and `9797` respectively. -The Javadoc on fields is used to populate the `description` attribute. For instance, the description of `server.ip` is "IP address to listen to.". +This exposes three properties where `my.server.name` has no default and `my.server.ip` and `my.server.port` defaults to `"127.0.0.1"` and `9797` respectively. +The Javadoc on fields is used to populate the `description` attribute. For instance, the description of `my.server.ip` is "IP address to listen to.". NOTE: You should only use plain text with `@ConfigurationProperties` field Javadoc, since they are not processed before being added to the JSON. @@ -88,7 +88,7 @@ Consider the following example: [source,java,indent=0,subs="verbatim,quotes,attributes"] ---- -include::{docs-java}/configurationmetadata/annotationprocessor/automaticmetadatageneration/MessagingProperties.java[] +include::{docs-java}/configurationmetadata/annotationprocessor/automaticmetadatageneration/MyMessagingProperties.java[] ---- In order to document default values for properties in the class above, you could add the following content to <>: @@ -97,11 +97,11 @@ In order to document default values for properties in the class above, you could ---- {"properties": [ { - "name": "acme.messaging.addresses", + "name": "my.messaging.addresses", "defaultValue": ["a", "b"] }, { - "name": "acme.messaging.container-type", + "name": "my.messaging.container-type", "defaultValue": "simple" } ]} @@ -119,10 +119,10 @@ Consider the updated example: [source,java,indent=0,subs="verbatim,quotes,attributes"] ---- -include::{docs-java}/configurationmetadata/annotationprocessor/automaticmetadatageneration/nestedproperties/ServerProperties.java[] +include::{docs-java}/configurationmetadata/annotationprocessor/automaticmetadatageneration/nestedproperties/MyServerProperties.java[] ---- -The preceding example produces metadata information for `server.name`, `server.host.ip`, and `server.host.port` properties. +The preceding example produces metadata information for `my.server.name`, `my.server.host.ip`, and `my.server.host.port` properties. You can use the `@NestedConfigurationProperty` annotation on a field to indicate that a regular (non-inner) class should be treated as if it were nested. TIP: This has no effect on collections and maps, as those types are automatically identified, and a single metadata property is generated for each of them. diff --git a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/configuration-metadata/format.adoc b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/configuration-metadata/format.adoc index 28c8b33f50..d9298d3b02 100644 --- a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/configuration-metadata/format.adoc +++ b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/configuration-metadata/format.adoc @@ -142,7 +142,7 @@ The JSON object contained in the `properties` array can contain the attributes d | `type` | String -| The full signature of the data type of the property (for example, `java.lang.String`) but also a full generic type (such as `java.util.Map`). +| The full signature of the data type of the property (for example, `java.lang.String`) but also a full generic type (such as `java.util.Map`). You can use this attribute to guide the user as to the types of values that they can enter. For consistency, the type of a primitive is specified by using its wrapper counterpart (for example, `boolean` becomes `java.lang.Boolean`). Note that this class may be a complex type that gets converted from a `String` as values are bound. @@ -204,12 +204,12 @@ This is still supported in a deprecated fashion and should no longer be used. If no reason and replacement are available, an empty `deprecation` object should be set. Deprecation can also be specified declaratively in code by adding the `@DeprecatedConfigurationProperty` annotation to the getter exposing the deprecated property. -For instance, assume that the `app.acme.target` property was confusing and was renamed to `app.acme.name`. +For instance, assume that the `my.app.target` property was confusing and was renamed to `my.app.name`. The following example shows how to handle that situation: [source,java,indent=0] ---- -include::{docs-java}/configurationmetadata/format/group/AcmeProperties.java[] +include::{docs-java}/configurationmetadata/format/group/MyProperties.java[] ---- NOTE: There is no way to set a `level`. diff --git a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/configuration-metadata/manual-hints.adoc b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/configuration-metadata/manual-hints.adoc index c94e59f635..662c64ffa5 100644 --- a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/configuration-metadata/manual-hints.adoc +++ b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/configuration-metadata/manual-hints.adoc @@ -16,11 +16,11 @@ Each value may have a description as well. If your property is of type `Map`, you can provide hints for both the keys and the values (but not for the map itself). The special `.keys` and `.values` suffixes must refer to the keys and the values, respectively. -Assume a `sample.contexts` maps magic `String` values to an integer, as shown in the following example: +Assume a `my.contexts` maps magic `String` values to an integer, as shown in the following example: [source,java,indent=0] ---- -include::{docs-java}/configurationmetadata/manualhints/valuehint/SampleProperties.java[] +include::{docs-java}/configurationmetadata/manualhints/valuehint/MyProperties.java[] ---- The magic values are (in this example) are `sample1` and `sample2`. @@ -30,7 +30,7 @@ In order to offer additional content assistance for the keys, you could add the ---- {"hints": [ { - "name": "sample.contexts.keys", + "name": "my.contexts.keys", "values": [ { "value": "sample1" diff --git a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/features/caching.adoc b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/features/caching.adoc index 5a8226f046..731795bf39 100644 --- a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/features/caching.adoc +++ b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/features/caching.adoc @@ -11,7 +11,7 @@ In a nutshell, to add caching to an operation of your service add the relevant a [source,java,indent=0] ---- -include::{docs-java}/features/caching/MathService.java[] +include::{docs-java}/features/caching/MyMathService.java[] ---- This example demonstrates the use of caching on a potentially costly operation. @@ -61,7 +61,7 @@ The following example sets a flag to say that `null` values should be passed dow [source,java,indent=0] ---- -include::{docs-java}/features/caching/provider/CacheManagerCustomizerConfiguration.java[] +include::{docs-java}/features/caching/provider/MyCacheManagerConfiguration.java[] ---- NOTE: In the preceding example, an auto-configured `ConcurrentMapCacheManager` is expected. @@ -92,8 +92,8 @@ Even if the JSR-107 standard does not enforce a standardized way to define the l spring: cache: jcache: - provider: "com.acme.MyCachingProvider" - config: "classpath:acme.xml" + provider: "com.example.MyCachingProvider" + config: "classpath:example.xml" ---- NOTE: When a cache library offers both a native implementation and JSR-107 support, Spring Boot prefers the JSR-107 support, so that the same features are available if you switch to a different JSR-107 implementation. @@ -177,7 +177,7 @@ The following example shows a customizer that configures a specific entry expira [source,java,indent=0] ---- -include::{docs-java}/features/caching/provider/couchbase/CouchbaseCacheManagerConfiguration.java[] +include::{docs-java}/features/caching/provider/couchbase/MyCouchbaseCacheManagerConfiguration.java[] ---- @@ -208,7 +208,7 @@ The following example shows a customizer that configures a specific time to live [source,java,indent=0] ---- -include::{docs-java}/features/caching/provider/redis/RedisCacheManagerConfiguration.java[] +include::{docs-java}/features/caching/provider/redis/MyRedisCacheManagerConfiguration.java[] ---- diff --git a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/features/developing-auto-configuration.adoc b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/features/developing-auto-configuration.adoc index 1dc9991261..cb283ad7c8 100644 --- a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/features/developing-auto-configuration.adoc +++ b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/features/developing-auto-configuration.adoc @@ -152,11 +152,11 @@ Concretely, each test should create a well defined `ApplicationContext` that rep `ApplicationContextRunner` provides a great way to achieve that. `ApplicationContextRunner` is usually defined as a field of the test class to gather the base, common configuration. -The following example makes sure that `UserServiceAutoConfiguration` is always invoked: +The following example makes sure that `MyServiceAutoConfiguration` is always invoked: [source,java,indent=0] ---- -include::{docs-java}/features/developingautoconfiguration/testing/UserServiceAutoConfigurationTests.java[tag=runner] +include::{docs-java}/features/developingautoconfiguration/testing/MyServiceAutoConfigurationTests.java[tag=runner] ---- TIP: If multiple auto-configurations have to be defined, there is no need to order their declarations as they are invoked in the exact same order as when running the application. @@ -167,14 +167,14 @@ Invoking `run` provides a callback context that can be used with `AssertJ`. [source,java,indent=0] ---- -include::{docs-java}/features/developingautoconfiguration/testing/UserServiceAutoConfigurationTests.java[tag=test-user-config] +include::{docs-java}/features/developingautoconfiguration/testing/MyServiceAutoConfigurationTests.java[tag=test-user-config] ---- It is also possible to easily customize the `Environment`, as shown in the following example: [source,java,indent=0] ---- -include::{docs-java}/features/developingautoconfiguration/testing/UserServiceAutoConfigurationTests.java[tag=test-env] +include::{docs-java}/features/developingautoconfiguration/testing/MyServiceAutoConfigurationTests.java[tag=test-env] ---- The runner can also be used to display the `ConditionEvaluationReport`. @@ -183,7 +183,7 @@ The following example shows how to use the `ConditionEvaluationReportLoggingList [source,java,indent=0] ---- -include::{docs-java}/features/developingautoconfiguration/testing/ConditionEvaluationReportTests.java[] +include::{docs-java}/features/developingautoconfiguration/testing/MyConditionEvaluationReportingTests.java[] ---- @@ -198,11 +198,11 @@ If you need to test an auto-configuration that only operates in a Servlet or Rea ==== Overriding the Classpath It is also possible to test what happens when a particular class and/or package is not present at runtime. Spring Boot ships with a `FilteredClassLoader` that can easily be used by the runner. -In the following example, we assert that if `UserService` is not present, the auto-configuration is properly disabled: +In the following example, we assert that if `MyService` is not present, the auto-configuration is properly disabled: [source,java,indent=0] ---- -include::{docs-java}/features/developingautoconfiguration/testing/UserServiceAutoConfigurationTests.java[tag=test-classloader] +include::{docs-java}/features/developingautoconfiguration/testing/MyServiceAutoConfigurationTests.java[tag=test-classloader] ---- diff --git a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/features/developing-web-applications.adoc b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/features/developing-web-applications.adoc index a32cdad673..aecb06feb7 100644 --- a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/features/developing-web-applications.adoc +++ b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/features/developing-web-applications.adoc @@ -69,7 +69,7 @@ If you need to add or customize converters, you can use Spring Boot's `HttpMessa [source,java,indent=0] ---- -include::{docs-java}/features/developingwebapplications/springmvc/messageconverters/HttpMessageConvertersConfiguration.java[] +include::{docs-java}/features/developingwebapplications/springmvc/messageconverters/MyHttpMessageConvertersConfiguration.java[] ---- Any `HttpMessageConverter` bean that is present in the context is added to the list of converters. @@ -352,7 +352,7 @@ You can also define a class annotated with `@ControllerAdvice` to customize the include::{docs-java}/features/developingwebapplications/springmvc/errorhandling/MyControllerAdvice.java[] ---- -In the preceding example, if `YourException` is thrown by a controller defined in the same package as `AcmeController`, a JSON representation of the `CustomErrorType` POJO is used instead of the `ErrorAttributes` representation. +In the preceding example, if `YourException` is thrown by a controller defined in the same package as `SomeController`, a JSON representation of the `CustomErrorType` POJO is used instead of the `ErrorAttributes` representation. In some cases, errors handled at the controller level are not recorded by the <>. Applications can ensure that such exceptions are recorded with the request metrics by setting the handled exception as a request attribute: @@ -419,14 +419,14 @@ This abstraction works directly with the underlying embedded servlet container a [source,java,indent=0,subs="verbatim,quotes,attributes"] ---- -include::{docs-java}/features/developingwebapplications/springmvc/errorhandling/errorpageswithoutspringmvc/ErrorPageConfiguration.java[] +include::{docs-java}/features/developingwebapplications/springmvc/errorhandling/errorpageswithoutspringmvc/MyErrorPagesConfiguration.java[] ---- NOTE: If you register an `ErrorPage` with a path that ends up being handled by a `Filter` (as is common with some non-Spring web frameworks, like Jersey and Wicket), then the `Filter` has to be explicitly registered as an `ERROR` dispatcher, as shown in the following example: [source,java,indent=0,subs="verbatim,quotes,attributes"] ---- -include::{docs-java}/features/developingwebapplications/springmvc/errorhandling/errorpageswithoutspringmvc/ServletFilterConfiguration.java[] +include::{docs-java}/features/developingwebapplications/springmvc/errorhandling/errorpageswithoutspringmvc/MyFilterConfiguration.java[] ---- Note that the default `FilterRegistrationBean` does not include the `ERROR` dispatcher type. @@ -469,7 +469,7 @@ Using {spring-framework-docs}/web.html#mvc-cors-controller[controller method COR [source,java,indent=0] ---- -include::{docs-java}/features/developingwebapplications/springmvc/cors/CorsConfiguration.java[] +include::{docs-java}/features/developingwebapplications/springmvc/cors/MyCorsConfiguration.java[] ---- @@ -491,12 +491,12 @@ include::{docs-java}/features/developingwebapplications/springwebflux/MyRestCont [source,java,indent=0] ---- -include::{docs-java}/features/developingwebapplications/springwebflux/RoutingConfiguration.java[] +include::{docs-java}/features/developingwebapplications/springwebflux/MyRoutingConfiguration.java[] ---- [source,java,indent=0] ---- -include::{docs-java}/features/developingwebapplications/springwebflux/UserHandler.java[] +include::{docs-java}/features/developingwebapplications/springwebflux/MyUserHandler.java[] ---- WebFlux is part of the Spring Framework and detailed information is available in its {spring-framework-docs}/web-reactive.html#webflux-fn[reference documentation]. @@ -540,7 +540,7 @@ If you need to add or customize codecs, you can create a custom `CodecCustomizer [source,java,indent=0] ---- -include::{docs-java}/features/developingwebapplications/springwebflux/httpcodecs/CodecConfiguration.java[] +include::{docs-java}/features/developingwebapplications/springwebflux/httpcodecs/MyCodecsConfiguration.java[] ---- You can also leverage <>. @@ -610,11 +610,11 @@ The first step to customizing this feature often involves using the existing mec For that, you can add a bean of type `ErrorAttributes`. To change the error handling behavior, you can implement `ErrorWebExceptionHandler` and register a bean definition of that type. -Because a `WebExceptionHandler` is quite low-level, Spring Boot also provides a convenient `AbstractErrorWebExceptionHandler` to let you handle errors in a WebFlux functional way, as shown in the following example: +Because a `ErrorWebExceptionHandler` is quite low-level, Spring Boot also provides a convenient `AbstractErrorWebExceptionHandler` to let you handle errors in a WebFlux functional way, as shown in the following example: [source,java,indent=0,subs="verbatim,quotes,attributes"] ---- -include::{docs-java}/features/developingwebapplications/springwebflux/errorhandling/CustomErrorWebExceptionHandler.java[] +include::{docs-java}/features/developingwebapplications/springwebflux/errorhandling/MyErrorWebExceptionHandler.java[] ---- For a more complete picture, you can also subclass `DefaultErrorWebExceptionHandler` directly and override specific methods. @@ -624,7 +624,7 @@ Applications can ensure that such exceptions are recorded with the request metri [source,java,indent=0,subs="verbatim,quotes,attributes"] ---- -include::{docs-java}/features/developingwebapplications/springwebflux/errorhandling/ExceptionHandlingController.java[] +include::{docs-java}/features/developingwebapplications/springwebflux/errorhandling/MyExceptionHandlingController.java[] ---- @@ -702,7 +702,7 @@ To get started with Jersey, include the `spring-boot-starter-jersey` as a depend [source,java,indent=0,subs="verbatim,quotes,attributes"] ---- -include::{docs-java}/features/developingwebapplications/jersey/JerseyConfig.java[] +include::{docs-java}/features/developingwebapplications/jersey/MyJerseyConfig.java[] ---- WARNING: Jersey's support for scanning executable archives is rather limited. @@ -715,7 +715,7 @@ All the registered endpoints should be `@Components` with HTTP resource annotati [source,java,indent=0,subs="verbatim,quotes,attributes"] ---- -include::{docs-java}/features/developingwebapplications/jersey/Endpoint.java[] +include::{docs-java}/features/developingwebapplications/jersey/MyEndpoint.java[] ---- Since the `Endpoint` is a Spring `@Component`, its lifecycle is managed by Spring and you can use the `@Autowired` annotation to inject dependencies and use the `@Value` annotation to inject external configuration. @@ -829,7 +829,7 @@ The following example shows programmatically setting the port: [source,java,indent=0] ---- -include::{docs-java}/features/developingwebapplications/embeddedcontainer/customizing/programmatic/CustomizationBean.java[] +include::{docs-java}/features/developingwebapplications/embeddedcontainer/customizing/programmatic/MyWebServerFactoryCustomizer.java[] ---- `TomcatServletWebServerFactory`, `JettyServletWebServerFactory` and `UndertowServletWebServerFactory` are dedicated variants of `ConfigurableServletWebServerFactory` that have additional customization setter methods for Tomcat, Jetty and Undertow respectively. @@ -837,7 +837,7 @@ The following example shows how to customize `TomcatServletWebServerFactory` tha [source,java,indent=0,subs="verbatim,quotes,attributes"] ---- -include::{docs-java}/features/developingwebapplications/embeddedcontainer/customizing/programmatic/TomcatServerCustomizer.java[] +include::{docs-java}/features/developingwebapplications/embeddedcontainer/customizing/programmatic/MyTomcatWebServerFactoryCustomizer.java[] ---- diff --git a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/features/external-config.adoc b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/features/external-config.adoc index ac52951bb2..021d4051ac 100644 --- a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/features/external-config.adoc +++ b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/features/external-config.adoc @@ -73,23 +73,23 @@ For example, the `SPRING_APPLICATION_JSON` property can be supplied on the comma [indent=0] ---- - $ SPRING_APPLICATION_JSON='{"acme":{"name":"test"}}' java -jar myapp.jar + $ SPRING_APPLICATION_JSON='{"my":{"name":"test"}}' java -jar myapp.jar ---- -In the preceding example, you end up with `acme.name=test` in the Spring `Environment`. +In the preceding example, you end up with `my.name=test` in the Spring `Environment`. The same JSON can also be provided as a system property: [indent=0] ---- - $ java -Dspring.application.json='{"acme":{"name":"test"}}' -jar myapp.jar + $ java -Dspring.application.json='{"my":{"name":"test"}}' -jar myapp.jar ---- Or you could supply the JSON by using a command line argument: [indent=0] ---- - $ java -jar myapp.jar --spring.application.json='{"acme":{"name":"test"}}' + $ java -jar myapp.jar --spring.application.json='{"my":{"name":"test"}}' ---- If you are deploying to a classic Application Server, you could also use a JNDI variable named `java:comp/env/spring.application.json`. @@ -616,17 +616,17 @@ It is possible to bind a bean declaring standard JavaBean properties as shown in [source,java,indent=0] ---- -include::{docs-java}/features/externalconfig/typesafeconfigurationproperties/javabeanbinding/AcmeProperties.java[] +include::{docs-java}/features/externalconfig/typesafeconfigurationproperties/javabeanbinding/MyProperties.java[] ---- The preceding POJO defines the following properties: -* `acme.enabled`, with a value of `false` by default. -* `acme.remote-address`, with a type that can be coerced from `String`. -* `acme.security.username`, with a nested "security" object whose name is determined by the name of the property. +* `my.service.enabled`, with a value of `false` by default. +* `my.service.remote-address`, with a type that can be coerced from `String`. +* `my.service.security.username`, with a nested "security" object whose name is determined by the name of the property. In particular, the return type is not used at all there and could have been `SecurityProperties`. -* `acme.security.password`. -* `acme.security.roles`, with a collection of `String` that defaults to `USER`. +* `my.service.security.password`. +* `my.service.security.roles`, with a collection of `String` that defaults to `USER`. NOTE: The properties that map to `@ConfigurationProperties` classes available in Spring Boot, which are configured via properties files, YAML files, environment variables etc., are public API but the accessors (getters/setters) of the class itself are not meant to be used directly. @@ -657,7 +657,7 @@ The example in the previous section can be rewritten in an immutable fashion as [source,java,indent=0] ---- -include::{docs-java}/features/externalconfig/typesafeconfigurationproperties/constructorbinding/AcmeProperties.java[] +include::{docs-java}/features/externalconfig/typesafeconfigurationproperties/constructorbinding/MyProperties.java[] ---- In this setup, the `@ConstructorBinding` annotation is used to indicate that constructor binding should be used. @@ -666,12 +666,12 @@ This means that the binder will expect to find a constructor with the parameters Nested members of a `@ConstructorBinding` class (such as `Security` in the example above) will also be bound via their constructor. Default values can be specified using `@DefaultValue` and the same conversion service will be applied to coerce the `String` value to the target type of a missing property. -By default, if no properties are bound to `Security`, the `AcmeProperties` instance will contain a `null` value for `security`. +By default, if no properties are bound to `Security`, the `MyProperties` instance will contain a `null` value for `security`. If you wish you return a non-null instance of `Security` even when no properties are bound to it, you can use an empty `@DefaultValue` annotation to do so: [source,java,indent=0] ---- -include::{docs-java}/features/externalconfig/typesafeconfigurationproperties/constructorbinding/nonnull/AcmeProperties.java[] +include::{docs-java}/features/externalconfig/typesafeconfigurationproperties/constructorbinding/nonnull/MyProperties.java[] ---- @@ -715,7 +715,7 @@ include::{docs-java}/features/externalconfig/typesafeconfigurationproperties/ena When the `@ConfigurationProperties` bean is registered using configuration property scanning or via `@EnableConfigurationProperties`, the bean has a conventional name: `-`, where `` is the environment key prefix specified in the `@ConfigurationProperties` annotation and `` is the fully qualified name of the bean. If the annotation does not provide any prefix, only the fully qualified name of the bean is used. -The bean name in the example above is `acme-com.example.AcmeProperties`. +The bean name in the example above is `com.example.app-com.example.app.SomeProperties`. ==== We recommend that `@ConfigurationProperties` only deal with the environment and, in particular, does not inject other beans from the context. @@ -730,13 +730,14 @@ This style of configuration works particularly well with the `SpringApplication` [source,yaml,indent=0] ---- - acme: - remote-address: 192.168.1.1 - security: - username: admin - roles: - - USER - - ADMIN + my: + service: + remote-address: 192.168.1.1 + security: + username: admin + roles: + - USER + - ADMIN ---- To work with `@ConfigurationProperties` beans, you can inject them in the same way as any other bean, as shown in the following example: @@ -763,7 +764,7 @@ To configure a bean from the `Environment` properties, add `@ConfigurationProper include::{docs-java}/features/externalconfig/typesafeconfigurationproperties/thirdpartyconfiguration/ThirdPartyConfiguration.java[] ---- -Any JavaBean property defined with the `another` prefix is mapped onto that `AnotherComponent` bean in manner similar to the preceding `AcmeProperties` example. +Any JavaBean property defined with the `another` prefix is mapped onto that `AnotherComponent` bean in manner similar to the preceding `SomeProperties` example. @@ -776,7 +777,7 @@ As an example, consider the following `@ConfigurationProperties` class: [source,java,indent=0] ---- -include::{docs-java}/features/externalconfig/typesafeconfigurationproperties/relaxedbinding/OwnerProperties.java[] +include::{docs-java}/features/externalconfig/typesafeconfigurationproperties/relaxedbinding/MyPersonProperties.java[] ---- With the preceding code, the following properties names can all be used: @@ -786,20 +787,20 @@ With the preceding code, the following properties names can all be used: |=== | Property | Note -| `acme.my-project.person.first-name` +| `my.main-project.person.first-name` | Kebab case, which is recommended for use in `.properties` and `.yml` files. -| `acme.myProject.person.firstName` +| `my.main-project.person.firstName` | Standard camel case syntax. -| `acme.my_project.person.first_name` +| `my.main-project.person.first_name` | Underscore notation, which is an alternative format for use in `.properties` and `.yml` files. -| `ACME_MYPROJECT_PERSON_FIRSTNAME` +| `MY_MAINPROJECT_PERSON_FIRSTNAME` | Upper case format, which is recommended when using system environment variables. |=== -NOTE: The `prefix` value for the annotation _must_ be in kebab case (lowercase and separated by `-`, such as `acme.my-project.person`). +NOTE: The `prefix` value for the annotation _must_ be in kebab case (lowercase and separated by `-`, such as `my.main-project.person`). .relaxed binding rules per property source [cols="2,4,4"] @@ -823,7 +824,7 @@ NOTE: The `prefix` value for the annotation _must_ be in kebab case (lowercase a | Standard list syntax using `[ ]` or comma-separated values |=== -TIP: We recommend that, when possible, properties are stored in lower-case kebab format, such as `my.property-name=acme`. +TIP: We recommend that, when possible, properties are stored in lower-case kebab format, such as `my.person.first-name=Rod`. @@ -838,15 +839,15 @@ For example, consider binding the following properties to a `Map` [source,properties,indent=0,role="primary"] .Properties ---- - acme.map.[/key1]=value1 - acme.map.[/key2]=value2 - acme.map./key3=value3 + my.map.[/key1]=value1 + my.map.[/key2]=value2 + my.map./key3=value3 ---- [source,yaml,indent=0,role="secondary"] .Yaml ---- - acme: + my: map: "[/key1]": "value1" "[/key2]": "value2" @@ -882,7 +883,7 @@ For example, the configuration property `spring.main.log-startup-info` would be Environment variables can also be used when binding to object lists. To bind to a `List`, the element number should be surrounded with underscores in the variable name. -For example, the configuration property `my.acme[0].other` would use an environment variable named `MY_ACME_0_OTHER`. +For example, the configuration property `my.service[0].other` would use an environment variable named `MY_SERVICE_0_OTHER`. @@ -891,18 +892,18 @@ For example, the configuration property `my.acme[0].other` would use an environm When lists are configured in more than one place, overriding works by replacing the entire list. For example, assume a `MyPojo` object with `name` and `description` attributes that are `null` by default. -The following example exposes a list of `MyPojo` objects from `AcmeProperties`: +The following example exposes a list of `MyPojo` objects from `MyProperties`: [source,java,indent=0] ---- -include::{docs-java}/features/externalconfig/typesafeconfigurationproperties/mergingcomplextypes/list/AcmeProperties.java[tag=*] +include::{docs-java}/features/externalconfig/typesafeconfigurationproperties/mergingcomplextypes/list/MyProperties.java[] ---- Consider the following configuration: [source,yaml,indent=0,configblocks] ---- - acme: + my: list: - name: "my name" description: "my description" @@ -911,12 +912,12 @@ Consider the following configuration: config: activate: on-profile: "dev" - acme: + my: list: - name: "my another name" ---- -If the `dev` profile is not active, `AcmeProperties.list` contains one `MyPojo` entry, as previously defined. +If the `dev` profile is not active, `MyProperties.list` contains one `MyPojo` entry, as previously defined. If the `dev` profile is enabled, however, the `list` _still_ contains only one entry (with a name of `my another name` and a description of `null`). This configuration _does not_ add a second `MyPojo` instance to the list, and it does not merge the items. @@ -925,7 +926,7 @@ Consider the following example: [source,yaml,indent=0,configblocks] ---- - acme: + my: list: - name: "my name" description: "my description" @@ -936,28 +937,28 @@ Consider the following example: config: activate: on-profile: "dev" - acme: + my: list: - name: "my another name" ---- -In the preceding example, if the `dev` profile is active, `AcmeProperties.list` contains _one_ `MyPojo` entry (with a name of `my another name` and a description of `null`). +In the preceding example, if the `dev` profile is active, `MyProperties.list` contains _one_ `MyPojo` entry (with a name of `my another name` and a description of `null`). For YAML, both comma-separated lists and YAML lists can be used for completely overriding the contents of the list. For `Map` properties, you can bind with property values drawn from multiple sources. However, for the same property in multiple sources, the one with the highest priority is used. -The following example exposes a `Map` from `AcmeProperties`: +The following example exposes a `Map` from `MyProperties`: [source,java,indent=0] ---- -include::{docs-java}/features/externalconfig/typesafeconfigurationproperties/mergingcomplextypes/map/AcmeProperties.java[tag=*] +include::{docs-java}/features/externalconfig/typesafeconfigurationproperties/mergingcomplextypes/map/MyProperties.java[] ---- Consider the following configuration: [source,yaml,indent=0,configblocks] ---- - acme: + my: map: key1: name: "my name 1" @@ -967,7 +968,7 @@ Consider the following configuration: config: activate: on-profile: "dev" - acme: + my: map: key1: name: "dev name 1" @@ -976,7 +977,7 @@ Consider the following configuration: description: "dev description 2" ---- -If the `dev` profile is not active, `AcmeProperties.map` contains one entry with key `key1` (with a name of `my name 1` and a description of `my description 1`). +If the `dev` profile is not active, `MyProperties.map` contains one entry with key `key1` (with a name of `my name 1` and a description of `my description 1`). If the `dev` profile is enabled, however, `map` contains two entries with keys `key1` (with a name of `dev name 1` and a description of `my description 1`) and `key2` (with a name of `dev name 2` and a description of `dev description 2`). NOTE: The preceding merging rules apply to properties from all property sources, and not just files. @@ -1007,7 +1008,7 @@ Consider the following example: [source,java,indent=0] ---- -include::{docs-java}/features/externalconfig/typesafeconfigurationproperties/conversion/durations/javabeanbinding/AppSystemProperties.java[] +include::{docs-java}/features/externalconfig/typesafeconfigurationproperties/conversion/durations/javabeanbinding/MyProperties.java[] ---- To specify a session timeout of 30 seconds, `30`, `PT30S` and `30s` are all equivalent. @@ -1030,7 +1031,7 @@ If you prefer to use constructor binding, the same properties can be exposed, as [source,java,indent=0] ---- -include::{docs-java}/features/externalconfig/typesafeconfigurationproperties/conversion/durations/constructorbinding/AppSystemProperties.java[] +include::{docs-java}/features/externalconfig/typesafeconfigurationproperties/conversion/durations/constructorbinding/MyProperties.java[] ---- @@ -1071,7 +1072,7 @@ Consider the following example: [source,java,indent=0] ---- -include::{docs-java}/features/externalconfig/typesafeconfigurationproperties/conversion/datasizes/javabeanbinding/AppIoProperties.java[] +include::{docs-java}/features/externalconfig/typesafeconfigurationproperties/conversion/datasizes/javabeanbinding/MyProperties.java[] ---- To specify a buffer size of 10 megabytes, `10` and `10MB` are equivalent. @@ -1092,7 +1093,7 @@ If you prefer to use constructor binding, the same properties can be exposed, as [source,java,indent=0] ---- -include::{docs-java}/features/externalconfig/typesafeconfigurationproperties/conversion/datasizes/constructorbinding/AppIoProperties.java[] +include::{docs-java}/features/externalconfig/typesafeconfigurationproperties/conversion/datasizes/constructorbinding/MyProperties.java[] ---- TIP: If you are upgrading a `Long` property, make sure to define the unit (using `@DataSizeUnit`) if it isn't bytes. @@ -1108,17 +1109,17 @@ To do so, ensure that a compliant JSR-303 implementation is on your classpath an [source,java,indent=0] ---- -include::{docs-java}/features/externalconfig/typesafeconfigurationproperties/validate/AcmeProperties.java[] +include::{docs-java}/features/externalconfig/typesafeconfigurationproperties/validate/MyProperties.java[] ---- TIP: You can also trigger validation by annotating the `@Bean` method that creates the configuration properties with `@Validated`. To ensure that validation is always triggered for nested properties, even when no properties are found, the associated field must be annotated with `@Valid`. -The following example builds on the preceding `AcmeProperties` example: +The following example builds on the preceding `MyProperties` example: [source,java,indent=0] ---- -include::{docs-java}/features/externalconfig/typesafeconfigurationproperties/validate/nested/AcmeProperties.java[] +include::{docs-java}/features/externalconfig/typesafeconfigurationproperties/validate/nested/MyProperties.java[] ---- You can also add a custom Spring `Validator` by creating a bean definition called `configurationPropertiesValidator`. diff --git a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/features/messaging.adoc b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/features/messaging.adoc index 6fbdc7bb63..ba7581be8b 100644 --- a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/features/messaging.adoc +++ b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/features/messaging.adoc @@ -174,7 +174,7 @@ For instance, the following example exposes another factory that uses a specific [source,java,indent=0] ---- -include::{docs-java}/features/messaging/jms/receiving/custom/JmsConfiguration.java[] +include::{docs-java}/features/messaging/jms/receiving/custom/MyJmsConfiguration.java[] ---- Then you can use the factory in any `@JmsListener`-annotated method as follows: @@ -290,7 +290,7 @@ For instance, the following configuration class exposes another factory that use [source,java,indent=0] ---- -include::{docs-java}/features/messaging/amqp/receiving/custom/RabbitConfiguration.java[] +include::{docs-java}/features/messaging/amqp/receiving/custom/MyRabbitConfiguration.java[] ---- Then you can use the factory in any `@RabbitListener`-annotated method, as follows: @@ -387,7 +387,7 @@ To use the factory bean, wire `StreamsBuilder` into your `@Bean` as shown in the [source,java,indent=0] ---- -include::{docs-java}/features/messaging/kafka/streams/KafkaStreamsConfiguration.java[] +include::{docs-java}/features/messaging/kafka/streams/MyKafkaStreamsConfiguration.java[] ---- By default, the streams managed by the `StreamBuilder` object it creates are started automatically. @@ -440,7 +440,7 @@ You can also configure the Spring Kafka `JsonDeserializer` as follows: value-deserializer: "org.springframework.kafka.support.serializer.JsonDeserializer" properties: "[spring.json.value.default.type]": "com.example.Invoice" - "[spring.json.trusted.packages]": "com.example,org.acme" + "[spring.json.trusted.packages]": "com.example.main,com.example.another" ---- Similarly, you can disable the `JsonSerializer` default behavior of sending type information in headers: diff --git a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/features/nosql.adoc b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/features/nosql.adoc index cdc9bd12a6..e4a37b3a56 100644 --- a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/features/nosql.adoc +++ b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/features/nosql.adoc @@ -222,7 +222,7 @@ To enable transaction management, the following bean must be defined in your con [source,java,indent=0] ---- -include::{docs-java}/features/nosql/neo4j/repositories/Neo4jReactiveTransactionManagerConfiguration.java[] +include::{docs-java}/features/nosql/neo4j/repositories/MyNeo4jConfiguration.java[] ---- ==== @@ -527,7 +527,7 @@ For instance, you can customize the converters to use, as follows: [source,java,indent=0] ---- -include::{docs-java}/features/nosql/couchbase/repositories/CouchbaseConversionsConfiguration.java[] +include::{docs-java}/features/nosql/couchbase/repositories/MyCouchbaseConfiguration.java[] ---- diff --git a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/features/quartz.adoc b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/features/quartz.adoc index 97725b7a66..dab4aba336 100644 --- a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/features/quartz.adoc +++ b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/features/quartz.adoc @@ -52,5 +52,5 @@ Regular beans can also be injected in a similar manner, as shown in the followin [source,java,indent=0] ---- -include::{docs-java}/features/quartz/SampleJob.java[] +include::{docs-java}/features/quartz/MySampleJob.java[] ---- diff --git a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/features/resttemplate.adoc b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/features/resttemplate.adoc index 2f917f7bb8..b25cae16c6 100644 --- a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/features/resttemplate.adoc +++ b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/features/resttemplate.adoc @@ -31,7 +31,7 @@ The following example shows a customizer that configures the use of a proxy for [source,java,indent=0] ---- -include::{docs-java}/features/resttemplate/customization/RestTemplateProxyCustomizer.java[] +include::{docs-java}/features/resttemplate/customization/MyRestTemplateCustomizer.java[] ---- Finally, you can also create your own `RestTemplateBuilder` bean. @@ -40,7 +40,7 @@ The following example exposes a `RestTemplateBuilder` with what Spring Boot woul [source,java,indent=0] ---- -include::{docs-java}/features/resttemplate/customization/RestTemplateBuilderConfiguration.java[] +include::{docs-java}/features/resttemplate/customization/MyRestTemplateBuilderConfiguration.java[] ---- The most extreme (and rarely used) option is to create your own `RestTemplateBuilder` bean without using a configurer. diff --git a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/features/security.adoc b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/features/security.adoc index 59d6a05f0c..45b278fb41 100644 --- a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/features/security.adoc +++ b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/features/security.adoc @@ -62,7 +62,7 @@ For example, you can customize your security configuration by adding something l [source,java,indent=0] ---- -include::{docs-java}/features/security/springwebflux/CustomWebFluxSecurityConfiguration.java[] +include::{docs-java}/features/security/springwebflux/MyWebFluxSecurityConfiguration.java[] ---- @@ -141,7 +141,7 @@ For example, for servlet applications, you can add your own `SecurityFilterChain [source,java,indent=0] ---- -include::{docs-java}/features/security/oauth2/client/OAuthClientConfiguration.java[] +include::{docs-java}/features/security/oauth2/client/MyOAuthClientConfiguration.java[] ---- TIP: Spring Boot auto-configures an `InMemoryOAuth2AuthorizedClientService` which is used by Spring Security for the management of client registrations. diff --git a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/features/spring-application.adoc b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/features/spring-application.adoc index 950eb372d5..221236f964 100644 --- a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/features/spring-application.adoc +++ b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/features/spring-application.adoc @@ -188,7 +188,7 @@ The `SpringApplicationBuilder` lets you chain together multiple method calls and [source,java,indent=0] ---- -include::{docs-java}/features/springapplication/fluentbuilderapi/SpringApplicationBuilderExample.java[tag=*] +include::{docs-java}/features/springapplication/fluentbuilderapi/MyApplication.java[tag=*] ---- NOTE: There are some restrictions when creating an `ApplicationContext` hierarchy. @@ -242,14 +242,14 @@ For example, we can export the "Readiness" state of the application to a file so [source,java,indent=0] ---- -include::{docs-java}/features/springapplication/applicationavailability/managing/ReadinessStateExporter.java[] +include::{docs-java}/features/springapplication/applicationavailability/managing/MyReadinessStateExporter.java[] ---- We can also update the state of the application, when the application breaks and cannot recover: [source,java,indent=0] ---- -include::{docs-java}/features/springapplication/applicationavailability/managing/LocalCacheVerifier.java[] +include::{docs-java}/features/springapplication/applicationavailability/managing/MyLocalCacheVerifier.java[] ---- Spring Boot provides <>. @@ -334,7 +334,7 @@ The `ApplicationArguments` interface provides access to both the raw `String[]` [source,java,indent=0] ---- -include::{docs-java}/features/springapplication/applicationarguments/ApplicationArgumentsExample.java[] +include::{docs-java}/features/springapplication/applicationarguments/MyBean.java[] ---- TIP: Spring Boot also registers a `CommandLinePropertySource` with the Spring `Environment`. @@ -355,7 +355,7 @@ The following example shows a `CommandLineRunner` with a `run` method: [source,java,indent=0] ---- -include::{docs-java}/features/springapplication/commandlinerunner/CommandLineRunnerExample.java[] +include::{docs-java}/features/springapplication/commandlinerunner/MyCommandLineRunner.java[] ---- If several `CommandLineRunner` or `ApplicationRunner` beans are defined that must be called in a specific order, you can additionally implement the `org.springframework.core.Ordered` interface or use the `org.springframework.core.annotation.Order` annotation. diff --git a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/features/sql.adoc b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/features/sql.adoc index fb7d7a990e..7ceaa284ea 100644 --- a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/features/sql.adoc +++ b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/features/sql.adoc @@ -368,7 +368,7 @@ To use the `DSLContext`, you can inject it, as shown in the following example: [source,java,indent=0] ---- -include::{docs-java}/features/sql/jooq/dslcontext/JooqExample.java[tag=!method] +include::{docs-java}/features/sql/jooq/dslcontext/MyBean.java[tag=!method] ---- TIP: The jOOQ manual tends to use a variable named `create` to hold the `DSLContext`. @@ -377,7 +377,7 @@ You can then use the `DSLContext` to construct your queries, as shown in the fol [source,java,indent=0] ---- -include::{docs-java}/features/sql/jooq/dslcontext/JooqExample.java[tag=method] +include::{docs-java}/features/sql/jooq/dslcontext/MyBean.java[tag=method] ---- @@ -430,14 +430,14 @@ The following example shows how to manually override the database port while the [source,java,indent=0] ---- -include::{docs-java}/features/sql/r2dbc/MyR2dbcPortConfiguration.java[] +include::{docs-java}/features/sql/r2dbc/MyR2dbcConfiguration.java[] ---- The following examples show how to set some PostgreSQL connection options: [source,java,indent=0] ---- -include::{docs-java}/features/sql/r2dbc/CustomizeR2dbcPostgresOptionsConfiguration.java[tag=*] +include::{docs-java}/features/sql/r2dbc/MyPostgresR2dbcConfiguration.java[] ---- When a `ConnectionFactory` bean is available, the regular JDBC `DataSource` auto-configuration backs off. @@ -474,7 +474,7 @@ A `DatabaseClient` bean is auto-configured, and you can `@Autowire` it directly [source,java,indent=0] ---- -include::{docs-java}/features/sql/r2dbc/usingdatabaseclient/MyBean.java[tag=*] +include::{docs-java}/features/sql/r2dbc/usingdatabaseclient/MyBean.java[] ---- @@ -494,7 +494,7 @@ The following example shows a typical Spring Data repository interface definitio [source,java,indent=0] ---- -include::{docs-java}/features/sql/r2dbc/repositories/CityRepository.java[tag=*] +include::{docs-java}/features/sql/r2dbc/repositories/CityRepository.java[] ---- TIP: We have barely scratched the surface of Spring Data R2DBC. For complete details, see the {spring-data-r2dbc-docs}[Spring Data R2DBC reference documentation]. diff --git a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/features/testing.adoc b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/features/testing.adoc index 5f0836783e..ad768efead 100644 --- a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/features/testing.adoc +++ b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/features/testing.adoc @@ -165,7 +165,7 @@ have `@SpringBootTest` inject them using the `args` attribute. [source,java,indent=0] ---- -include::{docs-java}/features/testing/springbootapplications/usingapplicationarguments/ApplicationArgumentTests.java[] +include::{docs-java}/features/testing/springbootapplications/usingapplicationarguments/MyApplicationArgumentTests.java[] ---- @@ -177,7 +177,7 @@ If you have web endpoints that you want to test against this mock environment, y [source,java,indent=0] ---- -include::{docs-java}/features/testing/springbootapplications/withmockenvironment/MockMvcTests.java[] +include::{docs-java}/features/testing/springbootapplications/withmockenvironment/MyMockMvcTests.java[] ---- TIP: If you want to focus only on the web layer and not start a complete `ApplicationContext`, consider <>. @@ -186,7 +186,7 @@ Alternatively, you can configure a {spring-framework-docs}/testing.html#webtestc [source,java,indent=0] ---- -include::{docs-java}/features/testing/springbootapplications/withmockenvironment/MockWebTestClientTests.java[] +include::{docs-java}/features/testing/springbootapplications/withmockenvironment/MyMockWebTestClientTests.java[] ---- [TIP] @@ -211,7 +211,7 @@ For convenience, tests that need to make REST calls to the started server can ad [source,java,indent=0] ---- -include::{docs-java}/features/testing/springbootapplications/withrunningserver/RandomPortWebTestClientTests.java[] +include::{docs-java}/features/testing/springbootapplications/withrunningserver/MyRandomPortWebTestClientTests.java[] ---- This setup requires `spring-webflux` on the classpath. @@ -219,7 +219,7 @@ If you can't or won't add webflux, Spring Boot also provides a `TestRestTemplate [source,java,indent=0] ---- -include::{docs-java}/features/testing/springbootapplications/withrunningserver/RandomPortTestRestTemplateTests.java[] +include::{docs-java}/features/testing/springbootapplications/withrunningserver/MyRandomPortTestRestTemplateTests.java[] ---- @@ -238,7 +238,7 @@ If such test needs access to an `MBeanServer`, consider marking it dirty as well [source,java,indent=0] ---- -include::{docs-java}/features/testing/springbootapplications/jmx/SampleJmxTests.java[] +include::{docs-java}/features/testing/springbootapplications/jmx/MyJmxTests.java[] ---- @@ -357,7 +357,7 @@ For instance, the following example asserts that the actual number is a float va [source,java,indent=0] ---- -include::{docs-java}/features/testing/springbootapplications/jsontests/AssertJ.java[tag=*] +include::{docs-java}/features/testing/springbootapplications/jsontests/MyJsonAssertJTests.java[tag=*] ---- @@ -710,14 +710,14 @@ You can inject it by using `@Autowired` and use it in your tests as you normally [source,java,indent=0] ---- -include::{docs-java}/features/testing/springbootapplications/autoconfiguredspringrestdocs/withmockmvc/UserDocumentationTests.java[] +include::{docs-java}/features/testing/springbootapplications/autoconfiguredspringrestdocs/withmockmvc/MyUserDocumentationTests.java[] ---- If you require more control over Spring REST Docs configuration than offered by the attributes of `@AutoConfigureRestDocs`, you can use a `RestDocsMockMvcConfigurationCustomizer` bean, as shown in the following example: [source,java,indent=0] ---- -include::{docs-java}/features/testing/springbootapplications/autoconfiguredspringrestdocs/withmockmvc/CustomizationConfiguration.java[] +include::{docs-java}/features/testing/springbootapplications/autoconfiguredspringrestdocs/withmockmvc/MyRestDocsConfiguration.java[] ---- If you want to make use of Spring REST Docs support for a parameterized output directory, you can create a `RestDocumentationResultHandler` bean. @@ -726,7 +726,7 @@ The following example shows a `RestDocumentationResultHandler` being defined: [source,java,indent=0] ---- -include::{docs-java}/features/testing/springbootapplications/autoconfiguredspringrestdocs/withmockmvc/ResultHandlerConfiguration.java[] +include::{docs-java}/features/testing/springbootapplications/autoconfiguredspringrestdocs/withmockmvc/MyResultHandlerConfiguration.java[] ---- @@ -738,14 +738,14 @@ You can inject it by using `@Autowired` and use it in your tests as you normally [source,java,indent=0] ---- -include::{docs-java}/features/testing/springbootapplications/autoconfiguredspringrestdocs/withwebtestclient/UsersDocumentationTests.java[] +include::{docs-java}/features/testing/springbootapplications/autoconfiguredspringrestdocs/withwebtestclient/MyUsersDocumentationTests.java[] ---- If you require more control over Spring REST Docs configuration than offered by the attributes of `@AutoConfigureRestDocs`, you can use a `RestDocsWebTestClientConfigurationCustomizer` bean, as shown in the following example: [source,java,indent=0] ---- -include::{docs-java}/features/testing/springbootapplications/autoconfiguredspringrestdocs/withwebtestclient/AdvancedRestDocsConfiguration.java[] +include::{docs-java}/features/testing/springbootapplications/autoconfiguredspringrestdocs/withwebtestclient/MyRestDocsConfiguration.java[] ---- @@ -757,14 +757,14 @@ You can inject it by using `@Autowired` and use it in your tests as you normally [source,java,indent=0] ---- -include::{docs-java}/features/testing/springbootapplications/autoconfiguredspringrestdocs/withrestassured/UserDocumentationTests.java[] +include::{docs-java}/features/testing/springbootapplications/autoconfiguredspringrestdocs/withrestassured/MyUserDocumentationTests.java[] ---- If you require more control over Spring REST Docs configuration than offered by the attributes of `@AutoConfigureRestDocs`, a `RestDocsRestAssuredConfigurationCustomizer` bean can be used, as shown in the following example: [source,java,indent=0] ---- -include::{docs-java}/features/testing/springbootapplications/autoconfiguredspringrestdocs/withrestassured/AdvancedRestDocsConfiguration.java[] +include::{docs-java}/features/testing/springbootapplications/autoconfiguredspringrestdocs/withrestassured/MyRestDocsConfiguration.java[] ---- @@ -794,7 +794,7 @@ Additional auto-configurations can be added on a test-by-test basis by creating [source,java,indent=0] ---- -include::{docs-java}/features/testing/springbootapplications/additionalautoconfigurationandslicing/ExampleJdbcTests.java[] +include::{docs-java}/features/testing/springbootapplications/additionalautoconfigurationandslicing/MyJdbcTests.java[] ---- NOTE: Make sure to not use the regular `@Import` annotation to import auto-configurations as they are handled in a specific way by Spring Boot. @@ -821,7 +821,7 @@ You could define your `@SpringBootApplication` as follows: [source,java,indent=0] ---- -include::{docs-java}/features/testing/springbootapplications/userconfigurationandslicing/SampleApplication.java[] +include::{docs-java}/features/testing/springbootapplications/userconfigurationandslicing/MyApplication.java[] ---- Because this class is the source configuration for the test, any slice test actually tries to start Spring Batch, which is definitely not what you want to do. @@ -829,7 +829,7 @@ A recommended approach is to move that area-specific configuration to a separate [source,java,indent=0] ---- -include::{docs-java}/features/testing/springbootapplications/userconfigurationandslicing/BatchConfiguration.java[] +include::{docs-java}/features/testing/springbootapplications/userconfigurationandslicing/MyBatchConfiguration.java[] ---- NOTE: Depending on the complexity of your application, you may either have a single `@Configuration` class for your customizations or one class per domain area. @@ -840,14 +840,14 @@ For example, for a `@WebMvcTest`, the following configuration will not include t [source,java,indent=0] ---- -include::{docs-java}/features/testing/springbootapplications/userconfigurationandslicing/WebConfiguration.java[] +include::{docs-java}/features/testing/springbootapplications/userconfigurationandslicing/MyWebConfiguration.java[] ---- The configuration below will, however, cause the custom `WebMvcConfigurer` to be loaded by the test slice. [source,java,indent=0] ---- -include::{docs-java}/features/testing/springbootapplications/userconfigurationandslicing/TestWebMvcConfigurer.java[] +include::{docs-java}/features/testing/springbootapplications/userconfigurationandslicing/MyWebMvcConfigurer.java[] ---- Another source of confusion is classpath scanning. @@ -856,7 +856,7 @@ Your application may resemble the following code: [source,java,indent=0] ---- -include::{docs-java}/features/testing/springbootapplications/userconfigurationandslicing/scan/SampleApplication.java[] +include::{docs-java}/features/testing/springbootapplications/userconfigurationandslicing/scan/MyApplication.java[] ---- Doing so effectively overrides the default component scan directive with the side effect of scanning those two packages regardless of the slice that you chose. @@ -920,7 +920,7 @@ To use add `@ExtendWith(OutputCaptureExtension.class)` and inject `CapturedOutpu [source,java,indent=0] ---- -include::{docs-java}/features/testing/utilities/outputcapture/OutputCaptureTests.java[] +include::{docs-java}/features/testing/utilities/outputcapture/MyOutputCaptureTests.java[] ---- diff --git a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/getting-started/first-application.adoc b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/getting-started/first-application.adoc index 059d9035d6..f0758be629 100644 --- a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/getting-started/first-application.adoc +++ b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/getting-started/first-application.adoc @@ -147,11 +147,11 @@ If you run `mvn dependency:tree` again, you see that there are now a number of a [[getting-started.first-application.code]] === Writing the Code To finish our application, we need to create a single Java file. -By default, Maven compiles sources from `src/main/java`, so you need to create that directory structure and then add a file named `src/main/java/Example.java` to contain the following code: +By default, Maven compiles sources from `src/main/java`, so you need to create that directory structure and then add a file named `src/main/java/MyApplication.java` to contain the following code: [source,java,indent=0] ---- -include::{docs-java}/gettingstarted/firstapplication/code/Example.java[] +include::{docs-java}/gettingstarted/firstapplication/code/MyApplication.java[] ---- Although there is not much code here, quite a lot is going on. @@ -222,7 +222,7 @@ You should see output similar to the following: ....... . . . ....... . . . (log output here) ....... . . . - ........ Started Example in 2.222 seconds (JVM running for 6.514) + ........ Started MyApplication in 2.222 seconds (JVM running for 6.514) ---- If you open a web browser to `http://localhost:8080`, you should see the following output: @@ -322,7 +322,7 @@ To run that application, use the `java -jar` command, as follows: ....... . . . ....... . . . (log output here) ....... . . . - ........ Started Example in 2.536 seconds (JVM running for 2.864) + ........ Started MyApplication in 2.536 seconds (JVM running for 2.864) ---- As before, to exit the application, press `ctrl-c`. diff --git a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/howto/actuator.adoc b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/howto/actuator.adoc index d07035a371..1604013993 100644 --- a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/howto/actuator.adoc +++ b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/howto/actuator.adoc @@ -68,5 +68,5 @@ The following example shows one way to write such an exporter: [source,java,indent=0,subs="verbatim,quotes,attributes"] ---- -include::{docs-java}/howto/actuator/maphealthindicatorstometrics/MetricsHealthMicrometerExport.java[] +include::{docs-java}/howto/actuator/maphealthindicatorstometrics/MyHealthMetricsExportConfiguration.java[] ---- diff --git a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/howto/data-access.adoc b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/howto/data-access.adoc index 2e3aa1f68a..12af11c004 100644 --- a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/howto/data-access.adoc +++ b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/howto/data-access.adoc @@ -15,7 +15,7 @@ The following example shows how to define a data source in a bean: [source,java,indent=0,subs="verbatim,quotes,attributes"] ---- -include::{docs-java}/howto/dataaccess/configurecustomdatasource/FancyDataSourceConfiguration.java[] +include::{docs-java}/howto/dataaccess/configurecustomdatasource/custom/MyDataSourceConfiguration.java[] ---- The following example shows how to define a data source by setting properties: @@ -29,7 +29,7 @@ The following example shows how to define a data source by setting properties: pool-size: 30 ---- -Assuming that your `FancyDataSource` has regular JavaBean properties for the URL, the username, and the pool size, these settings are bound automatically before the `DataSource` is made available to other components. +Assuming that `SomeDataSource` has regular JavaBean properties for the URL, the username, and the pool size, these settings are bound automatically before the `DataSource` is made available to other components. Spring Boot also provides a utility builder class, called `DataSourceBuilder`, that can be used to create one of the standard data sources (if it is on the classpath). The builder can detect the one to use based on what's available on the classpath. @@ -39,7 +39,7 @@ The following example shows how to create a data source by using a `DataSourceBu [source,java,indent=0,subs="verbatim,quotes,attributes"] ---- -include::{docs-java}/howto/dataaccess/configurecustomdatasource/BasicDataSourceConfiguration.java[] +include::{docs-java}/howto/dataaccess/configurecustomdatasource/builder/MyDataSourceConfiguration.java[] ---- To run an app with that `DataSource`, all you need is the connection information. @@ -80,7 +80,7 @@ The following example shows how create a `HikariDataSource` with `DataSourceBuil [source,java,indent=0,subs="verbatim,quotes,attributes"] ---- -include::{docs-java}/howto/dataaccess/configurecustomdatasource/SimpleDataSourceConfiguration.java[] +include::{docs-java}/howto/dataaccess/configurecustomdatasource/simple/MyDataSourceConfiguration.java[] ---- You can even go further by leveraging what `DataSourceProperties` does for you -- that is, by providing a default embedded database with a sensible username and password if no URL is provided. @@ -90,7 +90,7 @@ To avoid that, you can redefine a custom `DataSourceProperties` on your custom n [source,java,indent=0,subs="verbatim,quotes,attributes"] ---- -include::{docs-java}/howto/dataaccess/configurecustomdatasource/ConfigurableDataSourceConfiguration.java[] +include::{docs-java}/howto/dataaccess/configurecustomdatasource/configurable/MyDataSourceConfiguration.java[] ---- This setup puts you _in sync_ with what Spring Boot does for you by default, except that a dedicated connection pool is chosen (in code) and its settings are exposed in the `app.datasource.configuration` sub namespace. @@ -127,7 +127,7 @@ In the following example, we provide the _exact_ same feature set as the auto-co [source,java,indent=0,subs="verbatim,quotes,attributes"] ---- -include::{docs-java}/howto/dataaccess/configuretwodatasources/SimpleDataSourcesConfiguration.java[] +include::{docs-java}/howto/dataaccess/configuretwodatasources/MyDataSourcesConfiguration.java[] ---- TIP: `firstDataSourceProperties` has to be flagged as `@Primary` so that the database initializer feature uses your copy (if you use the initializer). @@ -157,7 +157,7 @@ You can apply the same concept to the secondary `DataSource` as well, as shown i [source,java,indent=0,subs="verbatim,quotes,attributes"] ---- -include::{docs-java}/howto/dataaccess/configuretwodatasources/CompleteDataSourcesConfiguration.java[] +include::{docs-java}/howto/dataaccess/configuretwodatasources/MyCompleteDataSourcesConfiguration.java[] ---- The preceding example configures two data sources on custom namespaces with the same logic as Spring Boot would use in auto-configuration. @@ -188,7 +188,7 @@ To get more control, you can use the `@EntityScan` annotation, as shown in the f [source,java,indent=0,subs="verbatim,quotes,attributes"] ---- -include::{docs-java}/howto/dataaccess/separateentitydefinitionsfromspringconfiguration/Application.java[] +include::{docs-java}/howto/dataaccess/separateentitydefinitionsfromspringconfiguration/MyApplication.java[] ---- @@ -275,7 +275,7 @@ Then, add a `HibernatePropertiesCustomizer` bean as shown in the following examp [source,java,indent=0] ---- -include::{docs-java}/howto/dataaccess/configurehibernatesecondlevelcaching/HibernateSecondLevelCacheConfiguration.java[] +include::{docs-java}/howto/dataaccess/configurehibernatesecondlevelcaching/MyHibernateSecondLevelCacheConfiguration.java[] ---- This customizer will configure Hibernate to use the same `CacheManager` as the one that the application uses. @@ -308,7 +308,7 @@ You can also reuse `JpaProperties` to bind settings for each `EntityManagerFacto [source,java,indent=0,subs="verbatim,quotes,attributes"] ---- -include::{docs-java}/howto/dataaccess/usemultipleentitymanagers/CustomEntityManagerFactoryConfiguration.java[] +include::{docs-java}/howto/dataaccess/usemultipleentitymanagers/MyEntityManagerFactoryConfiguration.java[] ---- The example above creates an `EntityManagerFactory` using a `DataSource` bean named `firstDataSource`. diff --git a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/howto/spring-mvc.adoc b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/howto/spring-mvc.adoc index 848862b925..9d3700235d 100644 --- a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/howto/spring-mvc.adoc +++ b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/howto/spring-mvc.adoc @@ -164,7 +164,7 @@ If you would rather map to a different path, you can configure one as follows: spring: mvc: servlet: - path: "/acme" + path: "/mypath" ---- If you have additional servlets you can declare a `@Bean` of type `Servlet` or `ServletRegistrationBean` for each and Spring Boot will register them transparently to the container. diff --git a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/howto/webserver.adoc b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/howto/webserver.adoc index 92d6ee4f43..9cbf35d116 100644 --- a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/howto/webserver.adoc +++ b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/howto/webserver.adoc @@ -443,7 +443,7 @@ You can add an `org.apache.catalina.connector.Connector` to the `TomcatServletWe [source,java,indent=0,subs="verbatim,quotes,attributes"] ---- -include::{docs-java}/howto/webserver/enablemultipleconnectorsintomcat/TomcatMultipleConnectorsConfiguration.java[] +include::{docs-java}/howto/webserver/enablemultipleconnectorsintomcat/MyTomcatConfiguration.java[] ---- @@ -463,7 +463,7 @@ To switch to the `LegacyCookieProcessor`, use an `WebServerFactoryCustomizer` be [source,java,indent=0] ---- -include::{docs-java}/howto/webserver/usetomcatlegacycookieprocessor/LegacyCookieProcessorConfiguration.java[] +include::{docs-java}/howto/webserver/usetomcatlegacycookieprocessor/MyLegacyCookieProcessorConfiguration.java[] ---- @@ -490,7 +490,7 @@ Add an `UndertowBuilderCustomizer` to the `UndertowServletWebServerFactory` and [source,java,indent=0,subs="verbatim,quotes,attributes"] ---- -include::{docs-java}/howto/webserver/enablemultiplelistenersinundertow/UndertowMultipleListenersConfiguration.java[] +include::{docs-java}/howto/webserver/enablemultiplelistenersinundertow/MyUndertowConfiguration.java[] ---- diff --git a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/using/spring-beans-and-dependency-injection.adoc b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/using/spring-beans-and-dependency-injection.adoc index 3184a9a813..7dd3f916cb 100644 --- a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/using/spring-beans-and-dependency-injection.adoc +++ b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/using/spring-beans-and-dependency-injection.adoc @@ -10,14 +10,14 @@ The following example shows a `@Service` Bean that uses constructor injection to [source,java,indent=0] ---- -include::{docs-java}/using/springbeansanddependencyinjection/singleconstructor/DatabaseAccountService.java[] +include::{docs-java}/using/springbeansanddependencyinjection/singleconstructor/MyAccountService.java[] ---- If a bean has more than one constructor, you'll need to mark the one you want Spring to use with `@Autowired`: [source,java,indent=0] ---- -include::{docs-java}/using/springbeansanddependencyinjection/multipleconstructors/DatabaseAccountService.java[] +include::{docs-java}/using/springbeansanddependencyinjection/multipleconstructors/MyAccountService.java[] ---- TIP: Notice how using constructor injection lets the `riskAssessor` field be marked as `final`, indicating that it cannot be subsequently changed. diff --git a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/actuator/cloudfoundry/customcontextpath/CloudFoundryCustomContextPathConfiguration.java b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/actuator/cloudfoundry/customcontextpath/MyCloudFoundryConfiguration.java similarity index 97% rename from spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/actuator/cloudfoundry/customcontextpath/CloudFoundryCustomContextPathConfiguration.java rename to spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/actuator/cloudfoundry/customcontextpath/MyCloudFoundryConfiguration.java index 7114a8cffb..3712cbc09a 100644 --- a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/actuator/cloudfoundry/customcontextpath/CloudFoundryCustomContextPathConfiguration.java +++ b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/actuator/cloudfoundry/customcontextpath/MyCloudFoundryConfiguration.java @@ -37,7 +37,7 @@ import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; @Configuration(proxyBeanMethods = false) -public class CloudFoundryCustomContextPathConfiguration { +public class MyCloudFoundryConfiguration { @Bean public TomcatServletWebServerFactory servletWebServerFactory() { diff --git a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/actuator/endpoints/implementingcustom/CustomData.java b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/actuator/endpoints/implementingcustom/CustomData.java new file mode 100644 index 0000000000..89e2683ffa --- /dev/null +++ b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/actuator/endpoints/implementingcustom/CustomData.java @@ -0,0 +1,38 @@ +/* + * Copyright 2012-2021 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.springframework.boot.docs.actuator.endpoints.implementingcustom; + +class CustomData { + + private final String name; + + private final int counter; + + CustomData(String name, int counter) { + this.name = name; + this.counter = counter; + } + + String getName() { + return this.name; + } + + int getCounter() { + return this.counter; + } + +} diff --git a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/actuator/endpoints/implementingcustom/CustomEndpoint.java b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/actuator/endpoints/implementingcustom/MyEndpoint.java similarity index 71% rename from spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/actuator/endpoints/implementingcustom/CustomEndpoint.java rename to spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/actuator/endpoints/implementingcustom/MyEndpoint.java index 74eca85acb..a1b9babab2 100644 --- a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/actuator/endpoints/implementingcustom/CustomEndpoint.java +++ b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/actuator/endpoints/implementingcustom/MyEndpoint.java @@ -21,41 +21,20 @@ import org.springframework.boot.actuate.endpoint.annotation.ReadOperation; import org.springframework.boot.actuate.endpoint.annotation.WriteOperation; @Endpoint(id = "custom") -public class CustomEndpoint { +public class MyEndpoint { // tag::read[] @ReadOperation - public CustomData getCustomData() { + public CustomData getData() { return new CustomData("test", 5); } // end::read[] // tag::write[] @WriteOperation - public void updateCustomData(String name, int counter) { + public void updateData(String name, int counter) { // injects "test" and 42 } // end::write[] - public static class CustomData { - - private final String name; - - private final int counter; - - public CustomData(String name, int counter) { - this.name = name; - this.counter = counter; - } - - public String getName() { - return this.name; - } - - public int getCounter() { - return this.counter; - } - - } - } diff --git a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/actuator/metrics/customizing/MetricsFilterConfiguration.java b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/actuator/metrics/customizing/MyMetricsFilterConfiguration.java similarity index 95% rename from spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/actuator/metrics/customizing/MetricsFilterConfiguration.java rename to spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/actuator/metrics/customizing/MyMetricsFilterConfiguration.java index 45132b3ebe..281b213e17 100644 --- a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/actuator/metrics/customizing/MetricsFilterConfiguration.java +++ b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/actuator/metrics/customizing/MyMetricsFilterConfiguration.java @@ -22,7 +22,7 @@ import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; @Configuration(proxyBeanMethods = false) -public class MetricsFilterConfiguration { +public class MyMetricsFilterConfiguration { @Bean public MeterFilter renameRegionTagMeterFilter() { diff --git a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/actuator/metrics/gettingstarted/specifictype/MyMeterRegistryConfiguration.java b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/actuator/metrics/gettingstarted/specifictype/MyMeterRegistryConfiguration.java index 4a5aa888d3..3e32dfab23 100644 --- a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/actuator/metrics/gettingstarted/specifictype/MyMeterRegistryConfiguration.java +++ b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/actuator/metrics/gettingstarted/specifictype/MyMeterRegistryConfiguration.java @@ -28,7 +28,7 @@ import org.springframework.context.annotation.Configuration; public class MyMeterRegistryConfiguration { @Bean - MeterRegistryCustomizer graphiteMetricsNamingConvention() { + public MeterRegistryCustomizer graphiteMetricsNamingConvention() { return (registry) -> registry.config().namingConvention(this::name); } diff --git a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/actuator/metrics/registeringcustom/MetricsMeterRegistryInjection.java b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/actuator/metrics/registeringcustom/MyBean.java similarity index 90% rename from spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/actuator/metrics/registeringcustom/MetricsMeterRegistryInjection.java rename to spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/actuator/metrics/registeringcustom/MyBean.java index 53819b1add..ec5bf8bc13 100644 --- a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/actuator/metrics/registeringcustom/MetricsMeterRegistryInjection.java +++ b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/actuator/metrics/registeringcustom/MyBean.java @@ -22,11 +22,11 @@ import io.micrometer.core.instrument.Tags; import org.springframework.stereotype.Component; @Component -public class MetricsMeterRegistryInjection { +public class MyBean { private final Dictionary dictionary; - MetricsMeterRegistryInjection(MeterRegistry registry) { + public MyBean(MeterRegistry registry) { this.dictionary = Dictionary.load(); registry.gauge("dictionary.size", Tags.empty(), this.dictionary.getWords().size()); } diff --git a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/actuator/metrics/registeringcustom/SampleMeterBinderConfiguration.java b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/actuator/metrics/registeringcustom/MyMeterBinderConfiguration.java similarity index 91% rename from spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/actuator/metrics/registeringcustom/SampleMeterBinderConfiguration.java rename to spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/actuator/metrics/registeringcustom/MyMeterBinderConfiguration.java index a425e2b808..37d191005d 100644 --- a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/actuator/metrics/registeringcustom/SampleMeterBinderConfiguration.java +++ b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/actuator/metrics/registeringcustom/MyMeterBinderConfiguration.java @@ -21,10 +21,10 @@ import io.micrometer.core.instrument.binder.MeterBinder; import org.springframework.context.annotation.Bean; -public class SampleMeterBinderConfiguration { +public class MyMeterBinderConfiguration { @Bean - MeterBinder queueSize(Queue queue) { + public MeterBinder queueSize(Queue queue) { return (registry) -> Gauge.builder("queueSize", queue::size).register(registry); } diff --git a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/actuator/metrics/supported/mongodb/command/SampleCommandTagsProviderConfiguration.java b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/actuator/metrics/supported/mongodb/command/MyCommandTagsProviderConfiguration.java similarity index 89% rename from spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/actuator/metrics/supported/mongodb/command/SampleCommandTagsProviderConfiguration.java rename to spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/actuator/metrics/supported/mongodb/command/MyCommandTagsProviderConfiguration.java index 617daaf7b0..066a9ebd0d 100644 --- a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/actuator/metrics/supported/mongodb/command/SampleCommandTagsProviderConfiguration.java +++ b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/actuator/metrics/supported/mongodb/command/MyCommandTagsProviderConfiguration.java @@ -22,10 +22,10 @@ import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; @Configuration(proxyBeanMethods = false) -public class SampleCommandTagsProviderConfiguration { +public class MyCommandTagsProviderConfiguration { @Bean - MongoCommandTagsProvider customCommandTagsProvider() { + public MongoCommandTagsProvider customCommandTagsProvider() { return new CustomCommandTagsProvider(); } diff --git a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/actuator/metrics/supported/mongodb/connectionpool/CustomConnectionPoolTagsProvider.java b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/actuator/metrics/supported/mongodb/connectionpool/CustomConnectionPoolTagsProvider.java index 2263b94497..ece9565a5a 100644 --- a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/actuator/metrics/supported/mongodb/connectionpool/CustomConnectionPoolTagsProvider.java +++ b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/actuator/metrics/supported/mongodb/connectionpool/CustomConnectionPoolTagsProvider.java @@ -20,7 +20,7 @@ import com.mongodb.event.ConnectionPoolCreatedEvent; import io.micrometer.core.instrument.Tag; import io.micrometer.core.instrument.binder.mongodb.MongoConnectionPoolTagsProvider; -class CustomConnectionPoolTagsProvider implements MongoConnectionPoolTagsProvider { +public class CustomConnectionPoolTagsProvider implements MongoConnectionPoolTagsProvider { @Override public Iterable connectionPoolTags(ConnectionPoolCreatedEvent event) { diff --git a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/actuator/metrics/supported/mongodb/connectionpool/SampleConnectionPoolTagsProviderConfiguration.java b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/actuator/metrics/supported/mongodb/connectionpool/MyConnectionPoolTagsProviderConfiguration.java similarity index 88% rename from spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/actuator/metrics/supported/mongodb/connectionpool/SampleConnectionPoolTagsProviderConfiguration.java rename to spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/actuator/metrics/supported/mongodb/connectionpool/MyConnectionPoolTagsProviderConfiguration.java index 921e6afbeb..72bcadf507 100644 --- a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/actuator/metrics/supported/mongodb/connectionpool/SampleConnectionPoolTagsProviderConfiguration.java +++ b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/actuator/metrics/supported/mongodb/connectionpool/MyConnectionPoolTagsProviderConfiguration.java @@ -22,10 +22,10 @@ import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; @Configuration(proxyBeanMethods = false) -public class SampleConnectionPoolTagsProviderConfiguration { +public class MyConnectionPoolTagsProviderConfiguration { @Bean - MongoConnectionPoolTagsProvider customConnectionPoolTagsProvider() { + public MongoConnectionPoolTagsProvider customConnectionPoolTagsProvider() { return new CustomConnectionPoolTagsProvider(); } diff --git a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/configurationmetadata/annotationprocessor/automaticmetadatageneration/MessagingProperties.java b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/configurationmetadata/annotationprocessor/automaticmetadatageneration/MyMessagingProperties.java similarity index 94% rename from spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/configurationmetadata/annotationprocessor/automaticmetadatageneration/MessagingProperties.java rename to spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/configurationmetadata/annotationprocessor/automaticmetadatageneration/MyMessagingProperties.java index a2d331d893..672f1e8310 100644 --- a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/configurationmetadata/annotationprocessor/automaticmetadatageneration/MessagingProperties.java +++ b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/configurationmetadata/annotationprocessor/automaticmetadatageneration/MyMessagingProperties.java @@ -22,8 +22,8 @@ import java.util.List; import org.springframework.boot.context.properties.ConfigurationProperties; -@ConfigurationProperties(prefix = "acme.messaging") -public class MessagingProperties { +@ConfigurationProperties(prefix = "my.messaging") +public class MyMessagingProperties { private List addresses = new ArrayList<>(Arrays.asList("a", "b")); diff --git a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/configurationmetadata/annotationprocessor/automaticmetadatageneration/ServerProperties.java b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/configurationmetadata/annotationprocessor/automaticmetadatageneration/MyServerProperties.java similarity index 94% rename from spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/configurationmetadata/annotationprocessor/automaticmetadatageneration/ServerProperties.java rename to spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/configurationmetadata/annotationprocessor/automaticmetadatageneration/MyServerProperties.java index 4a23fa90fb..e5193aa70e 100644 --- a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/configurationmetadata/annotationprocessor/automaticmetadatageneration/ServerProperties.java +++ b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/configurationmetadata/annotationprocessor/automaticmetadatageneration/MyServerProperties.java @@ -18,8 +18,8 @@ package org.springframework.boot.docs.configurationmetadata.annotationprocessor. import org.springframework.boot.context.properties.ConfigurationProperties; -@ConfigurationProperties(prefix = "server") -public class ServerProperties { +@ConfigurationProperties(prefix = "my.server") +public class MyServerProperties { /** * Name of the server. diff --git a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/configurationmetadata/annotationprocessor/automaticmetadatageneration/nestedproperties/ServerProperties.java b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/configurationmetadata/annotationprocessor/automaticmetadatageneration/nestedproperties/MyServerProperties.java similarity index 94% rename from spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/configurationmetadata/annotationprocessor/automaticmetadatageneration/nestedproperties/ServerProperties.java rename to spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/configurationmetadata/annotationprocessor/automaticmetadatageneration/nestedproperties/MyServerProperties.java index 851b1d5290..07f328bd8f 100644 --- a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/configurationmetadata/annotationprocessor/automaticmetadatageneration/nestedproperties/ServerProperties.java +++ b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/configurationmetadata/annotationprocessor/automaticmetadatageneration/nestedproperties/MyServerProperties.java @@ -18,8 +18,8 @@ package org.springframework.boot.docs.configurationmetadata.annotationprocessor. import org.springframework.boot.context.properties.ConfigurationProperties; -@ConfigurationProperties(prefix = "server") -public class ServerProperties { +@ConfigurationProperties(prefix = "my.server") +public class MyServerProperties { private String name; diff --git a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/configurationmetadata/format/group/AcmeProperties.java b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/configurationmetadata/format/group/MyProperties.java similarity index 89% rename from spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/configurationmetadata/format/group/AcmeProperties.java rename to spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/configurationmetadata/format/group/MyProperties.java index ede19c7edc..100d19bb63 100644 --- a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/configurationmetadata/format/group/AcmeProperties.java +++ b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/configurationmetadata/format/group/MyProperties.java @@ -19,8 +19,8 @@ package org.springframework.boot.docs.configurationmetadata.format.group; import org.springframework.boot.context.properties.ConfigurationProperties; import org.springframework.boot.context.properties.DeprecatedConfigurationProperty; -@ConfigurationProperties("app.acme") -public class AcmeProperties { +@ConfigurationProperties("my.app") +public class MyProperties { private String name; @@ -33,7 +33,7 @@ public class AcmeProperties { } @Deprecated - @DeprecatedConfigurationProperty(replacement = "app.acme.name") + @DeprecatedConfigurationProperty(replacement = "my.app.name") public String getTarget() { return this.name; } diff --git a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/configurationmetadata/manualhints/valuehint/SampleProperties.java b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/configurationmetadata/manualhints/valuehint/MyProperties.java similarity index 94% rename from spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/configurationmetadata/manualhints/valuehint/SampleProperties.java rename to spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/configurationmetadata/manualhints/valuehint/MyProperties.java index 326e01e16f..6c7bbad126 100644 --- a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/configurationmetadata/manualhints/valuehint/SampleProperties.java +++ b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/configurationmetadata/manualhints/valuehint/MyProperties.java @@ -20,8 +20,8 @@ import java.util.Map; import org.springframework.boot.context.properties.ConfigurationProperties; -@ConfigurationProperties("sample") -public class SampleProperties { +@ConfigurationProperties("my") +public class MyProperties { private Map contexts; diff --git a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/deployment/cloud/cloudfoundry/bindingtoservices/MyBean.java b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/deployment/cloud/cloudfoundry/bindingtoservices/MyBean.java index af31d13675..cf625dc4d9 100644 --- a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/deployment/cloud/cloudfoundry/bindingtoservices/MyBean.java +++ b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/deployment/cloud/cloudfoundry/bindingtoservices/MyBean.java @@ -21,7 +21,7 @@ import org.springframework.core.env.Environment; import org.springframework.stereotype.Component; @Component -class MyBean implements EnvironmentAware { +public class MyBean implements EnvironmentAware { @SuppressWarnings("unused") private String instanceId; diff --git a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/caching/MathService.java b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/caching/MyMathService.java similarity index 96% rename from spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/caching/MathService.java rename to spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/caching/MyMathService.java index 4bd866be50..1d1eb82f49 100644 --- a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/caching/MathService.java +++ b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/caching/MyMathService.java @@ -20,7 +20,7 @@ import org.springframework.cache.annotation.Cacheable; import org.springframework.stereotype.Component; @Component -public class MathService { +public class MyMathService { @Cacheable("piDecimals") public int computePiDecimal(int precision) { diff --git a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/caching/provider/CacheManagerCustomizerConfiguration.java b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/caching/provider/MyCacheManagerConfiguration.java similarity index 93% rename from spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/caching/provider/CacheManagerCustomizerConfiguration.java rename to spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/caching/provider/MyCacheManagerConfiguration.java index 0dfeff31bc..2d3ea03f37 100644 --- a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/caching/provider/CacheManagerCustomizerConfiguration.java +++ b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/caching/provider/MyCacheManagerConfiguration.java @@ -21,8 +21,8 @@ import org.springframework.cache.concurrent.ConcurrentMapCacheManager; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; -@Configuration -public class CacheManagerCustomizerConfiguration { +@Configuration(proxyBeanMethods = false) +public class MyCacheManagerConfiguration { @Bean public CacheManagerCustomizer cacheManagerCustomizer() { diff --git a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/caching/provider/couchbase/CouchbaseCacheManagerConfiguration.java b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/caching/provider/couchbase/MyCouchbaseCacheManagerConfiguration.java similarity index 96% rename from spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/caching/provider/couchbase/CouchbaseCacheManagerConfiguration.java rename to spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/caching/provider/couchbase/MyCouchbaseCacheManagerConfiguration.java index ba23a5ca82..2e47ea9240 100644 --- a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/caching/provider/couchbase/CouchbaseCacheManagerConfiguration.java +++ b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/caching/provider/couchbase/MyCouchbaseCacheManagerConfiguration.java @@ -24,7 +24,7 @@ import org.springframework.context.annotation.Configuration; import org.springframework.data.couchbase.cache.CouchbaseCacheConfiguration; @Configuration(proxyBeanMethods = false) -public class CouchbaseCacheManagerConfiguration { +public class MyCouchbaseCacheManagerConfiguration { @Bean public CouchbaseCacheManagerBuilderCustomizer myCouchbaseCacheManagerBuilderCustomizer() { diff --git a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/caching/provider/redis/RedisCacheManagerConfiguration.java b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/caching/provider/redis/MyRedisCacheManagerConfiguration.java similarity index 96% rename from spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/caching/provider/redis/RedisCacheManagerConfiguration.java rename to spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/caching/provider/redis/MyRedisCacheManagerConfiguration.java index e0217b868a..399c24b72a 100644 --- a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/caching/provider/redis/RedisCacheManagerConfiguration.java +++ b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/caching/provider/redis/MyRedisCacheManagerConfiguration.java @@ -24,7 +24,7 @@ import org.springframework.context.annotation.Configuration; import org.springframework.data.redis.cache.RedisCacheConfiguration; @Configuration(proxyBeanMethods = false) -public class RedisCacheManagerConfiguration { +public class MyRedisCacheManagerConfiguration { @Bean public RedisCacheManagerBuilderCustomizer myRedisCacheManagerBuilderCustomizer() { diff --git a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/developingautoconfiguration/testing/ConditionEvaluationReportTests.java b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/developingautoconfiguration/testing/MyConditionEvaluationReportingTests.java similarity index 78% rename from spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/developingautoconfiguration/testing/ConditionEvaluationReportTests.java rename to spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/developingautoconfiguration/testing/MyConditionEvaluationReportingTests.java index 8a08ee152b..a71b521736 100644 --- a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/developingautoconfiguration/testing/ConditionEvaluationReportTests.java +++ b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/developingautoconfiguration/testing/MyConditionEvaluationReportingTests.java @@ -22,15 +22,17 @@ import org.springframework.boot.autoconfigure.logging.ConditionEvaluationReportL import org.springframework.boot.logging.LogLevel; import org.springframework.boot.test.context.runner.ApplicationContextRunner; -public class ConditionEvaluationReportTests { +public class MyConditionEvaluationReportingTests { @Test void autoConfigTest() { - ConditionEvaluationReportLoggingListener initializer = new ConditionEvaluationReportLoggingListener( - LogLevel.INFO); - new ApplicationContextRunner().withInitializer(initializer).run((context) -> { - // Test something... - }); + // @formatter:off + new ApplicationContextRunner() + .withInitializer(new ConditionEvaluationReportLoggingListener(LogLevel.INFO)) + .run((context) -> { + // Test something... + }); + // @formatter:on } } diff --git a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/developingautoconfiguration/testing/UserService.java b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/developingautoconfiguration/testing/MyService.java similarity index 92% rename from spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/developingautoconfiguration/testing/UserService.java rename to spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/developingautoconfiguration/testing/MyService.java index ed443db2da..7db64935af 100644 --- a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/developingautoconfiguration/testing/UserService.java +++ b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/developingautoconfiguration/testing/MyService.java @@ -16,11 +16,11 @@ package org.springframework.boot.docs.features.developingautoconfiguration.testing; -public class UserService { +public class MyService { private final String name; - public UserService(String name) { + public MyService(String name) { this.name = name; } diff --git a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/developingautoconfiguration/testing/UserServiceAutoConfiguration.java b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/developingautoconfiguration/testing/MyServiceAutoConfiguration.java similarity index 85% rename from spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/developingautoconfiguration/testing/UserServiceAutoConfiguration.java rename to spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/developingautoconfiguration/testing/MyServiceAutoConfiguration.java index 2371133d06..19343df832 100644 --- a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/developingautoconfiguration/testing/UserServiceAutoConfiguration.java +++ b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/developingautoconfiguration/testing/MyServiceAutoConfiguration.java @@ -20,19 +20,19 @@ import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; import org.springframework.boot.context.properties.ConfigurationProperties; import org.springframework.boot.context.properties.EnableConfigurationProperties; -import org.springframework.boot.docs.features.developingautoconfiguration.testing.UserServiceAutoConfiguration.UserProperties; +import org.springframework.boot.docs.features.developingautoconfiguration.testing.MyServiceAutoConfiguration.UserProperties; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; @Configuration(proxyBeanMethods = false) -@ConditionalOnClass(UserService.class) +@ConditionalOnClass(MyService.class) @EnableConfigurationProperties(UserProperties.class) -public class UserServiceAutoConfiguration { +public class MyServiceAutoConfiguration { @Bean @ConditionalOnMissingBean - public UserService userService(UserProperties properties) { - return new UserService(properties.getName()); + public MyService userService(UserProperties properties) { + return new MyService(properties.getName()); } @ConfigurationProperties("user") diff --git a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/developingautoconfiguration/testing/UserServiceAutoConfigurationTests.java b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/developingautoconfiguration/testing/MyServiceAutoConfigurationTests.java similarity index 74% rename from spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/developingautoconfiguration/testing/UserServiceAutoConfigurationTests.java rename to spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/developingautoconfiguration/testing/MyServiceAutoConfigurationTests.java index 1110cef9e3..03269ecf55 100644 --- a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/developingautoconfiguration/testing/UserServiceAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/developingautoconfiguration/testing/MyServiceAutoConfigurationTests.java @@ -26,11 +26,11 @@ import org.springframework.context.annotation.Configuration; import static org.assertj.core.api.Assertions.assertThat; -class UserServiceAutoConfigurationTests { +class MyServiceAutoConfigurationTests { // tag::runner[] private final ApplicationContextRunner contextRunner = new ApplicationContextRunner() - .withConfiguration(AutoConfigurations.of(UserServiceAutoConfiguration.class)); + .withConfiguration(AutoConfigurations.of(MyServiceAutoConfiguration.class)); // end::runner[] @@ -38,8 +38,8 @@ class UserServiceAutoConfigurationTests { @Test void serviceNameCanBeConfigured() { this.contextRunner.withPropertyValues("user.name=test123").run((context) -> { - assertThat(context).hasSingleBean(UserService.class); - assertThat(context.getBean(UserService.class).getName()).isEqualTo("test123"); + assertThat(context).hasSingleBean(MyService.class); + assertThat(context.getBean(MyService.class).getName()).isEqualTo("test123"); }); } // end::test-env[] @@ -47,8 +47,8 @@ class UserServiceAutoConfigurationTests { // tag::test-classloader[] @Test void serviceIsIgnoredIfLibraryIsNotPresent() { - this.contextRunner.withClassLoader(new FilteredClassLoader(UserService.class)) - .run((context) -> assertThat(context).doesNotHaveBean("userService")); + this.contextRunner.withClassLoader(new FilteredClassLoader(MyService.class)) + .run((context) -> assertThat(context).doesNotHaveBean("myService")); } // end::test-classloader[] @@ -56,8 +56,8 @@ class UserServiceAutoConfigurationTests { @Test void defaultServiceBacksOff() { this.contextRunner.withUserConfiguration(UserConfiguration.class).run((context) -> { - assertThat(context).hasSingleBean(UserService.class); - assertThat(context).getBean("myUserService").isSameAs(context.getBean(UserService.class)); + assertThat(context).hasSingleBean(MyService.class); + assertThat(context).getBean("myCustomService").isSameAs(context.getBean(MyService.class)); }); } @@ -65,8 +65,8 @@ class UserServiceAutoConfigurationTests { static class UserConfiguration { @Bean - UserService myUserService() { - return new UserService("mine"); + MyService myCustomService() { + return new MyService("mine"); } } diff --git a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/developingwebapplications/embeddedcontainer/customizing/programmatic/TomcatServerCustomizer.java b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/developingwebapplications/embeddedcontainer/customizing/programmatic/MyTomcatWebServerFactoryCustomizer.java similarity index 90% rename from spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/developingwebapplications/embeddedcontainer/customizing/programmatic/TomcatServerCustomizer.java rename to spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/developingwebapplications/embeddedcontainer/customizing/programmatic/MyTomcatWebServerFactoryCustomizer.java index 61358aec8e..7a83567d3f 100644 --- a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/developingwebapplications/embeddedcontainer/customizing/programmatic/TomcatServerCustomizer.java +++ b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/developingwebapplications/embeddedcontainer/customizing/programmatic/MyTomcatWebServerFactoryCustomizer.java @@ -23,7 +23,7 @@ import org.springframework.boot.web.server.WebServerFactoryCustomizer; import org.springframework.stereotype.Component; @Component -public class TomcatServerCustomizer implements WebServerFactoryCustomizer { +public class MyTomcatWebServerFactoryCustomizer implements WebServerFactoryCustomizer { @Override public void customize(TomcatServletWebServerFactory server) { diff --git a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/developingwebapplications/embeddedcontainer/customizing/programmatic/CustomizationBean.java b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/developingwebapplications/embeddedcontainer/customizing/programmatic/MyWebServerFactoryCustomizer.java similarity index 90% rename from spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/developingwebapplications/embeddedcontainer/customizing/programmatic/CustomizationBean.java rename to spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/developingwebapplications/embeddedcontainer/customizing/programmatic/MyWebServerFactoryCustomizer.java index e3a3ab0099..bad3502428 100644 --- a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/developingwebapplications/embeddedcontainer/customizing/programmatic/CustomizationBean.java +++ b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/developingwebapplications/embeddedcontainer/customizing/programmatic/MyWebServerFactoryCustomizer.java @@ -21,7 +21,7 @@ import org.springframework.boot.web.servlet.server.ConfigurableServletWebServerF import org.springframework.stereotype.Component; @Component -public class CustomizationBean implements WebServerFactoryCustomizer { +public class MyWebServerFactoryCustomizer implements WebServerFactoryCustomizer { @Override public void customize(ConfigurableServletWebServerFactory server) { diff --git a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/developingwebapplications/jersey/Endpoint.java b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/developingwebapplications/jersey/MyEndpoint.java similarity index 97% rename from spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/developingwebapplications/jersey/Endpoint.java rename to spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/developingwebapplications/jersey/MyEndpoint.java index c935127ddd..1678226e7b 100644 --- a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/developingwebapplications/jersey/Endpoint.java +++ b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/developingwebapplications/jersey/MyEndpoint.java @@ -23,7 +23,7 @@ import org.springframework.stereotype.Component; @Component @Path("/hello") -public class Endpoint { +public class MyEndpoint { @GET public String message() { diff --git a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/developingwebapplications/jersey/JerseyConfig.java b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/developingwebapplications/jersey/MyJerseyConfig.java similarity index 88% rename from spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/developingwebapplications/jersey/JerseyConfig.java rename to spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/developingwebapplications/jersey/MyJerseyConfig.java index 05edef4f60..ccccd0391b 100644 --- a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/developingwebapplications/jersey/JerseyConfig.java +++ b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/developingwebapplications/jersey/MyJerseyConfig.java @@ -21,10 +21,10 @@ import org.glassfish.jersey.server.ResourceConfig; import org.springframework.stereotype.Component; @Component -public class JerseyConfig extends ResourceConfig { +public class MyJerseyConfig extends ResourceConfig { - public JerseyConfig() { - register(Endpoint.class); + public MyJerseyConfig() { + register(MyEndpoint.class); } } diff --git a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/developingwebapplications/springmvc/MyRestController.java b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/developingwebapplications/springmvc/MyRestController.java index 602ada12be..d139042e7f 100644 --- a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/developingwebapplications/springmvc/MyRestController.java +++ b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/developingwebapplications/springmvc/MyRestController.java @@ -43,7 +43,7 @@ public class MyRestController { } @GetMapping("/{user}/customers") - List getUserCustomers(@PathVariable Long userId) { + public List getUserCustomers(@PathVariable Long userId) { return this.userRepository.findById(userId).map(this.customerRepository::findByUser).get(); } diff --git a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/developingwebapplications/springmvc/cors/CorsConfiguration.java b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/developingwebapplications/springmvc/cors/MyCorsConfiguration.java similarity index 97% rename from spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/developingwebapplications/springmvc/cors/CorsConfiguration.java rename to spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/developingwebapplications/springmvc/cors/MyCorsConfiguration.java index b52f45ceee..53be9963ff 100644 --- a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/developingwebapplications/springmvc/cors/CorsConfiguration.java +++ b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/developingwebapplications/springmvc/cors/MyCorsConfiguration.java @@ -22,7 +22,7 @@ import org.springframework.web.servlet.config.annotation.CorsRegistry; import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; @Configuration(proxyBeanMethods = false) -public class CorsConfiguration { +public class MyCorsConfiguration { @Bean public WebMvcConfigurer corsConfigurer() { diff --git a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/developingwebapplications/springmvc/errorhandling/MyControllerAdvice.java b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/developingwebapplications/springmvc/errorhandling/MyControllerAdvice.java index 79c0f3a0a0..c72fa6034f 100644 --- a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/developingwebapplications/springmvc/errorhandling/MyControllerAdvice.java +++ b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/developingwebapplications/springmvc/errorhandling/MyControllerAdvice.java @@ -26,12 +26,12 @@ import org.springframework.web.bind.annotation.ExceptionHandler; import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.web.servlet.mvc.method.annotation.ResponseEntityExceptionHandler; -@ControllerAdvice(basePackageClasses = AcmeController.class) +@ControllerAdvice(basePackageClasses = SomeController.class) public class MyControllerAdvice extends ResponseEntityExceptionHandler { @ResponseBody @ExceptionHandler(MyException.class) - ResponseEntity handleControllerException(HttpServletRequest request, Throwable ex) { + public ResponseEntity handleControllerException(HttpServletRequest request, Throwable ex) { HttpStatus status = getStatus(request); return new ResponseEntity<>(new MyErrorBody(status.value(), ex.getMessage()), status); } diff --git a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/developingwebapplications/springmvc/errorhandling/AcmeController.java b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/developingwebapplications/springmvc/errorhandling/SomeController.java similarity index 96% rename from spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/developingwebapplications/springmvc/errorhandling/AcmeController.java rename to spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/developingwebapplications/springmvc/errorhandling/SomeController.java index 64c0b20926..6bb3e593e1 100644 --- a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/developingwebapplications/springmvc/errorhandling/AcmeController.java +++ b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/developingwebapplications/springmvc/errorhandling/SomeController.java @@ -16,6 +16,6 @@ package org.springframework.boot.docs.features.developingwebapplications.springmvc.errorhandling; -class AcmeController { +class SomeController { } diff --git a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/developingwebapplications/springmvc/errorhandling/errorpageswithoutspringmvc/ErrorPageConfiguration.java b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/developingwebapplications/springmvc/errorhandling/errorpageswithoutspringmvc/MyErrorPagesConfiguration.java similarity index 94% rename from spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/developingwebapplications/springmvc/errorhandling/errorpageswithoutspringmvc/ErrorPageConfiguration.java rename to spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/developingwebapplications/springmvc/errorhandling/errorpageswithoutspringmvc/MyErrorPagesConfiguration.java index 5a0a80568d..f609f23e55 100644 --- a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/developingwebapplications/springmvc/errorhandling/errorpageswithoutspringmvc/ErrorPageConfiguration.java +++ b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/developingwebapplications/springmvc/errorhandling/errorpageswithoutspringmvc/MyErrorPagesConfiguration.java @@ -23,8 +23,8 @@ import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.http.HttpStatus; -@Configuration -public class ErrorPageConfiguration { +@Configuration(proxyBeanMethods = false) +public class MyErrorPagesConfiguration { @Bean public ErrorPageRegistrar errorPageRegistrar() { diff --git a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/developingwebapplications/springmvc/errorhandling/errorpageswithoutspringmvc/ServletFilterConfiguration.java b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/developingwebapplications/springmvc/errorhandling/errorpageswithoutspringmvc/MyFilterConfiguration.java similarity index 94% rename from spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/developingwebapplications/springmvc/errorhandling/errorpageswithoutspringmvc/ServletFilterConfiguration.java rename to spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/developingwebapplications/springmvc/errorhandling/errorpageswithoutspringmvc/MyFilterConfiguration.java index 80c99f9b09..55e5818585 100644 --- a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/developingwebapplications/springmvc/errorhandling/errorpageswithoutspringmvc/ServletFilterConfiguration.java +++ b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/developingwebapplications/springmvc/errorhandling/errorpageswithoutspringmvc/MyFilterConfiguration.java @@ -24,8 +24,8 @@ import org.springframework.boot.web.servlet.FilterRegistrationBean; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; -@Configuration -public class ServletFilterConfiguration { +@Configuration(proxyBeanMethods = false) +public class MyFilterConfiguration { @Bean public FilterRegistrationBean myFilter() { diff --git a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/developingwebapplications/springmvc/messageconverters/HttpMessageConvertersConfiguration.java b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/developingwebapplications/springmvc/messageconverters/MyHttpMessageConvertersConfiguration.java similarity index 96% rename from spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/developingwebapplications/springmvc/messageconverters/HttpMessageConvertersConfiguration.java rename to spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/developingwebapplications/springmvc/messageconverters/MyHttpMessageConvertersConfiguration.java index d1d57d6890..50cc98cc3c 100644 --- a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/developingwebapplications/springmvc/messageconverters/HttpMessageConvertersConfiguration.java +++ b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/developingwebapplications/springmvc/messageconverters/MyHttpMessageConvertersConfiguration.java @@ -22,7 +22,7 @@ import org.springframework.context.annotation.Configuration; import org.springframework.http.converter.HttpMessageConverter; @Configuration(proxyBeanMethods = false) -public class HttpMessageConvertersConfiguration { +public class MyHttpMessageConvertersConfiguration { @Bean public HttpMessageConverters customConverters() { diff --git a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/developingwebapplications/springwebflux/RoutingConfiguration.java b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/developingwebapplications/springwebflux/MyRoutingConfiguration.java similarity index 93% rename from spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/developingwebapplications/springwebflux/RoutingConfiguration.java rename to spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/developingwebapplications/springwebflux/MyRoutingConfiguration.java index 9f410d3d29..e1d1e064d5 100644 --- a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/developingwebapplications/springwebflux/RoutingConfiguration.java +++ b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/developingwebapplications/springwebflux/MyRoutingConfiguration.java @@ -29,12 +29,12 @@ import static org.springframework.web.reactive.function.server.RequestPredicates import static org.springframework.web.reactive.function.server.RouterFunctions.route; @Configuration(proxyBeanMethods = false) -public class RoutingConfiguration { +public class MyRoutingConfiguration { private static final RequestPredicate ACCEPT_JSON = accept(MediaType.APPLICATION_JSON); @Bean - public RouterFunction monoRouterFunction(UserHandler userHandler) { + public RouterFunction monoRouterFunction(MyUserHandler userHandler) { // @formatter:off return route( GET("/{user}").and(ACCEPT_JSON), userHandler::getUser).andRoute( diff --git a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/developingwebapplications/springwebflux/UserHandler.java b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/developingwebapplications/springwebflux/MyUserHandler.java similarity index 97% rename from spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/developingwebapplications/springwebflux/UserHandler.java rename to spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/developingwebapplications/springwebflux/MyUserHandler.java index 6fff50a656..49a31e2731 100644 --- a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/developingwebapplications/springwebflux/UserHandler.java +++ b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/developingwebapplications/springwebflux/MyUserHandler.java @@ -23,7 +23,7 @@ import org.springframework.web.reactive.function.server.ServerRequest; import org.springframework.web.reactive.function.server.ServerResponse; @Component -public class UserHandler { +public class MyUserHandler { public Mono getUser(ServerRequest request) { /**/ return ServerResponse.ok().build(); diff --git a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/developingwebapplications/springwebflux/errorhandling/CustomErrorWebExceptionHandler.java b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/developingwebapplications/springwebflux/errorhandling/MyErrorWebExceptionHandler.java similarity index 92% rename from spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/developingwebapplications/springwebflux/errorhandling/CustomErrorWebExceptionHandler.java rename to spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/developingwebapplications/springwebflux/errorhandling/MyErrorWebExceptionHandler.java index 2bdce52af9..93273dda74 100644 --- a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/developingwebapplications/springwebflux/errorhandling/CustomErrorWebExceptionHandler.java +++ b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/developingwebapplications/springwebflux/errorhandling/MyErrorWebExceptionHandler.java @@ -32,9 +32,9 @@ import org.springframework.web.reactive.function.server.ServerResponse; import org.springframework.web.reactive.function.server.ServerResponse.BodyBuilder; @Component -public class CustomErrorWebExceptionHandler extends AbstractErrorWebExceptionHandler { +public class MyErrorWebExceptionHandler extends AbstractErrorWebExceptionHandler { - public CustomErrorWebExceptionHandler(ErrorAttributes errorAttributes, Resources resources, + public MyErrorWebExceptionHandler(ErrorAttributes errorAttributes, Resources resources, ApplicationContext applicationContext) { super(errorAttributes, resources, applicationContext); } diff --git a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/developingwebapplications/springwebflux/errorhandling/ExceptionHandlingController.java b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/developingwebapplications/springwebflux/errorhandling/MyExceptionHandlingController.java similarity index 91% rename from spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/developingwebapplications/springwebflux/errorhandling/ExceptionHandlingController.java rename to spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/developingwebapplications/springwebflux/errorhandling/MyExceptionHandlingController.java index ad4f80c143..b3e45caa1c 100644 --- a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/developingwebapplications/springwebflux/errorhandling/ExceptionHandlingController.java +++ b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/developingwebapplications/springwebflux/errorhandling/MyExceptionHandlingController.java @@ -24,7 +24,7 @@ import org.springframework.web.reactive.result.view.Rendering; import org.springframework.web.server.ServerWebExchange; @Controller -public class ExceptionHandlingController { +public class MyExceptionHandlingController { @GetMapping("/profile") public Rendering userProfile() { @@ -33,7 +33,7 @@ public class ExceptionHandlingController { } @ExceptionHandler(IllegalStateException.class) - Rendering handleIllegalState(ServerWebExchange exchange, IllegalStateException exc) { + public Rendering handleIllegalState(ServerWebExchange exchange, IllegalStateException exc) { exchange.getAttributes().putIfAbsent(ErrorAttributes.ERROR_ATTRIBUTE, exc); return Rendering.view("errorView").modelAttribute("message", exc.getMessage()).build(); } diff --git a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/developingwebapplications/springwebflux/httpcodecs/CodecConfiguration.java b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/developingwebapplications/springwebflux/httpcodecs/MyCodecsConfiguration.java similarity index 97% rename from spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/developingwebapplications/springwebflux/httpcodecs/CodecConfiguration.java rename to spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/developingwebapplications/springwebflux/httpcodecs/MyCodecsConfiguration.java index b085d19fc1..04a5e12715 100644 --- a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/developingwebapplications/springwebflux/httpcodecs/CodecConfiguration.java +++ b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/developingwebapplications/springwebflux/httpcodecs/MyCodecsConfiguration.java @@ -22,7 +22,7 @@ import org.springframework.context.annotation.Configuration; import org.springframework.http.codec.ServerSentEventHttpMessageReader; @Configuration(proxyBeanMethods = false) -public class CodecConfiguration { +public class MyCodecsConfiguration { @Bean public CodecCustomizer myCodecCustomizer() { diff --git a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/externalconfig/typesafeconfigurationproperties/constructorbinding/AcmeProperties.java b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/externalconfig/typesafeconfigurationproperties/constructorbinding/MyProperties.java similarity index 93% rename from spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/externalconfig/typesafeconfigurationproperties/constructorbinding/AcmeProperties.java rename to spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/externalconfig/typesafeconfigurationproperties/constructorbinding/MyProperties.java index b79507fdd4..5af0cde4b6 100644 --- a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/externalconfig/typesafeconfigurationproperties/constructorbinding/AcmeProperties.java +++ b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/externalconfig/typesafeconfigurationproperties/constructorbinding/MyProperties.java @@ -24,8 +24,8 @@ import org.springframework.boot.context.properties.ConstructorBinding; import org.springframework.boot.context.properties.bind.DefaultValue; @ConstructorBinding -@ConfigurationProperties("acme") -public class AcmeProperties { +@ConfigurationProperties("my.service") +public class MyProperties { // @fold:on // fields... private final boolean enabled; @@ -36,7 +36,7 @@ public class AcmeProperties { // @fold:off - public AcmeProperties(boolean enabled, InetAddress remoteAddress, Security security) { + public MyProperties(boolean enabled, InetAddress remoteAddress, Security security) { this.enabled = enabled; this.remoteAddress = remoteAddress; this.security = security; diff --git a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/externalconfig/typesafeconfigurationproperties/constructorbinding/nonnull/AcmeProperties.java b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/externalconfig/typesafeconfigurationproperties/constructorbinding/nonnull/MyProperties.java similarity index 92% rename from spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/externalconfig/typesafeconfigurationproperties/constructorbinding/nonnull/AcmeProperties.java rename to spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/externalconfig/typesafeconfigurationproperties/constructorbinding/nonnull/MyProperties.java index a93c4f93b3..11566766f7 100644 --- a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/externalconfig/typesafeconfigurationproperties/constructorbinding/nonnull/AcmeProperties.java +++ b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/externalconfig/typesafeconfigurationproperties/constructorbinding/nonnull/MyProperties.java @@ -24,8 +24,8 @@ import org.springframework.boot.context.properties.ConstructorBinding; import org.springframework.boot.context.properties.bind.DefaultValue; @ConstructorBinding -@ConfigurationProperties("acme") -public class AcmeProperties { +@ConfigurationProperties("my.service") +public class MyProperties { private final boolean enabled; @@ -34,7 +34,7 @@ public class AcmeProperties { private final Security security; // tag::code[] - public AcmeProperties(boolean enabled, InetAddress remoteAddress, @DefaultValue Security security) { + public MyProperties(boolean enabled, InetAddress remoteAddress, @DefaultValue Security security) { this.enabled = enabled; this.remoteAddress = remoteAddress; this.security = security; diff --git a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/externalconfig/typesafeconfigurationproperties/conversion/datasizes/constructorbinding/AppIoProperties.java b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/externalconfig/typesafeconfigurationproperties/conversion/datasizes/constructorbinding/MyProperties.java similarity index 90% rename from spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/externalconfig/typesafeconfigurationproperties/conversion/datasizes/constructorbinding/AppIoProperties.java rename to spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/externalconfig/typesafeconfigurationproperties/conversion/datasizes/constructorbinding/MyProperties.java index d00a68558c..27c1c1dde0 100644 --- a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/externalconfig/typesafeconfigurationproperties/conversion/datasizes/constructorbinding/AppIoProperties.java +++ b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/externalconfig/typesafeconfigurationproperties/conversion/datasizes/constructorbinding/MyProperties.java @@ -23,9 +23,9 @@ import org.springframework.boot.convert.DataSizeUnit; import org.springframework.util.unit.DataSize; import org.springframework.util.unit.DataUnit; -@ConfigurationProperties("app.io") +@ConfigurationProperties("my") @ConstructorBinding -public class AppIoProperties { +public class MyProperties { // @fold:on // fields... private final DataSize bufferSize; @@ -33,7 +33,7 @@ public class AppIoProperties { private final DataSize sizeThreshold; // @fold:off - public AppIoProperties(@DataSizeUnit(DataUnit.MEGABYTES) @DefaultValue("2MB") DataSize bufferSize, + public MyProperties(@DataSizeUnit(DataUnit.MEGABYTES) @DefaultValue("2MB") DataSize bufferSize, @DefaultValue("512B") DataSize sizeThreshold) { this.bufferSize = bufferSize; this.sizeThreshold = sizeThreshold; diff --git a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/externalconfig/typesafeconfigurationproperties/conversion/datasizes/javabeanbinding/AppIoProperties.java b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/externalconfig/typesafeconfigurationproperties/conversion/datasizes/javabeanbinding/MyProperties.java similarity index 95% rename from spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/externalconfig/typesafeconfigurationproperties/conversion/datasizes/javabeanbinding/AppIoProperties.java rename to spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/externalconfig/typesafeconfigurationproperties/conversion/datasizes/javabeanbinding/MyProperties.java index 2506980d43..05b9623268 100644 --- a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/externalconfig/typesafeconfigurationproperties/conversion/datasizes/javabeanbinding/AppIoProperties.java +++ b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/externalconfig/typesafeconfigurationproperties/conversion/datasizes/javabeanbinding/MyProperties.java @@ -21,8 +21,8 @@ import org.springframework.boot.convert.DataSizeUnit; import org.springframework.util.unit.DataSize; import org.springframework.util.unit.DataUnit; -@ConfigurationProperties("app.io") -public class AppIoProperties { +@ConfigurationProperties("my") +public class MyProperties { @DataSizeUnit(DataUnit.MEGABYTES) private DataSize bufferSize = DataSize.ofMegabytes(2); diff --git a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/externalconfig/typesafeconfigurationproperties/conversion/durations/constructorbinding/AppSystemProperties.java b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/externalconfig/typesafeconfigurationproperties/conversion/durations/constructorbinding/MyProperties.java similarity index 89% rename from spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/externalconfig/typesafeconfigurationproperties/conversion/durations/constructorbinding/AppSystemProperties.java rename to spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/externalconfig/typesafeconfigurationproperties/conversion/durations/constructorbinding/MyProperties.java index 4c45adeb86..d1d4183e96 100644 --- a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/externalconfig/typesafeconfigurationproperties/conversion/durations/constructorbinding/AppSystemProperties.java +++ b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/externalconfig/typesafeconfigurationproperties/conversion/durations/constructorbinding/MyProperties.java @@ -24,9 +24,9 @@ import org.springframework.boot.context.properties.ConstructorBinding; import org.springframework.boot.context.properties.bind.DefaultValue; import org.springframework.boot.convert.DurationUnit; -@ConfigurationProperties("app.system") +@ConfigurationProperties("my") @ConstructorBinding -public class AppSystemProperties { +public class MyProperties { // @fold:on // fields... private final Duration sessionTimeout; @@ -34,7 +34,7 @@ public class AppSystemProperties { private final Duration readTimeout; // @fold:off - public AppSystemProperties(@DurationUnit(ChronoUnit.SECONDS) @DefaultValue("30s") Duration sessionTimeout, + public MyProperties(@DurationUnit(ChronoUnit.SECONDS) @DefaultValue("30s") Duration sessionTimeout, @DefaultValue("1000ms") Duration readTimeout) { this.sessionTimeout = sessionTimeout; this.readTimeout = readTimeout; diff --git a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/externalconfig/typesafeconfigurationproperties/conversion/durations/javabeanbinding/AppSystemProperties.java b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/externalconfig/typesafeconfigurationproperties/conversion/durations/javabeanbinding/MyProperties.java similarity index 95% rename from spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/externalconfig/typesafeconfigurationproperties/conversion/durations/javabeanbinding/AppSystemProperties.java rename to spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/externalconfig/typesafeconfigurationproperties/conversion/durations/javabeanbinding/MyProperties.java index b2dc53101c..c9a0abea7c 100644 --- a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/externalconfig/typesafeconfigurationproperties/conversion/durations/javabeanbinding/AppSystemProperties.java +++ b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/externalconfig/typesafeconfigurationproperties/conversion/durations/javabeanbinding/MyProperties.java @@ -22,8 +22,8 @@ import java.time.temporal.ChronoUnit; import org.springframework.boot.context.properties.ConfigurationProperties; import org.springframework.boot.convert.DurationUnit; -@ConfigurationProperties("app.system") -public class AppSystemProperties { +@ConfigurationProperties("my") +public class MyProperties { @DurationUnit(ChronoUnit.SECONDS) private Duration sessionTimeout = Duration.ofSeconds(30); diff --git a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/externalconfig/typesafeconfigurationproperties/enablingannotatedtypes/MyApplication.java b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/externalconfig/typesafeconfigurationproperties/enablingannotatedtypes/MyApplication.java index 7427464e93..0756d581a6 100644 --- a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/externalconfig/typesafeconfigurationproperties/enablingannotatedtypes/MyApplication.java +++ b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/externalconfig/typesafeconfigurationproperties/enablingannotatedtypes/MyApplication.java @@ -20,7 +20,7 @@ import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.context.properties.ConfigurationPropertiesScan; @SpringBootApplication -@ConfigurationPropertiesScan({ "com.example.app", "org.acme.another" }) +@ConfigurationPropertiesScan({ "com.example.app", "com.example.another" }) public class MyApplication { } diff --git a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/externalconfig/typesafeconfigurationproperties/enablingannotatedtypes/MyConfiguration.java b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/externalconfig/typesafeconfigurationproperties/enablingannotatedtypes/MyConfiguration.java index 2e04a0630d..5ec4ea1885 100644 --- a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/externalconfig/typesafeconfigurationproperties/enablingannotatedtypes/MyConfiguration.java +++ b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/externalconfig/typesafeconfigurationproperties/enablingannotatedtypes/MyConfiguration.java @@ -20,7 +20,7 @@ import org.springframework.boot.context.properties.EnableConfigurationProperties import org.springframework.context.annotation.Configuration; @Configuration(proxyBeanMethods = false) -@EnableConfigurationProperties(AcmeProperties.class) +@EnableConfigurationProperties(SomeProperties.class) public class MyConfiguration { } diff --git a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/externalconfig/typesafeconfigurationproperties/enablingannotatedtypes/AcmeProperties.java b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/externalconfig/typesafeconfigurationproperties/enablingannotatedtypes/SomeProperties.java similarity index 97% rename from spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/externalconfig/typesafeconfigurationproperties/enablingannotatedtypes/AcmeProperties.java rename to spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/externalconfig/typesafeconfigurationproperties/enablingannotatedtypes/SomeProperties.java index 2776c4116e..674845bed6 100644 --- a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/externalconfig/typesafeconfigurationproperties/enablingannotatedtypes/AcmeProperties.java +++ b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/externalconfig/typesafeconfigurationproperties/enablingannotatedtypes/SomeProperties.java @@ -16,6 +16,6 @@ package org.springframework.boot.docs.features.externalconfig.typesafeconfigurationproperties.enablingannotatedtypes; -class AcmeProperties { +class SomeProperties { } diff --git a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/externalconfig/typesafeconfigurationproperties/javabeanbinding/AcmeProperties.java b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/externalconfig/typesafeconfigurationproperties/javabeanbinding/MyProperties.java similarity index 96% rename from spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/externalconfig/typesafeconfigurationproperties/javabeanbinding/AcmeProperties.java rename to spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/externalconfig/typesafeconfigurationproperties/javabeanbinding/MyProperties.java index 9313c7da6f..7d91ff68e9 100644 --- a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/externalconfig/typesafeconfigurationproperties/javabeanbinding/AcmeProperties.java +++ b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/externalconfig/typesafeconfigurationproperties/javabeanbinding/MyProperties.java @@ -23,8 +23,8 @@ import java.util.List; import org.springframework.boot.context.properties.ConfigurationProperties; -@ConfigurationProperties("acme") -public class AcmeProperties { +@ConfigurationProperties("my.service") +public class MyProperties { private boolean enabled; diff --git a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/externalconfig/typesafeconfigurationproperties/mergingcomplextypes/list/AcmeProperties.java b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/externalconfig/typesafeconfigurationproperties/mergingcomplextypes/list/MyProperties.java similarity index 94% rename from spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/externalconfig/typesafeconfigurationproperties/mergingcomplextypes/list/AcmeProperties.java rename to spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/externalconfig/typesafeconfigurationproperties/mergingcomplextypes/list/MyProperties.java index 5393c209a8..0c5885cb42 100644 --- a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/externalconfig/typesafeconfigurationproperties/mergingcomplextypes/list/AcmeProperties.java +++ b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/externalconfig/typesafeconfigurationproperties/mergingcomplextypes/list/MyProperties.java @@ -21,8 +21,8 @@ import java.util.List; import org.springframework.boot.context.properties.ConfigurationProperties; -@ConfigurationProperties("acme") -public class AcmeProperties { +@ConfigurationProperties("my") +public class MyProperties { private final List list = new ArrayList<>(); diff --git a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/externalconfig/typesafeconfigurationproperties/mergingcomplextypes/map/AcmeProperties.java b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/externalconfig/typesafeconfigurationproperties/mergingcomplextypes/map/MyProperties.java similarity index 94% rename from spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/externalconfig/typesafeconfigurationproperties/mergingcomplextypes/map/AcmeProperties.java rename to spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/externalconfig/typesafeconfigurationproperties/mergingcomplextypes/map/MyProperties.java index 810abd9985..7719757861 100644 --- a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/externalconfig/typesafeconfigurationproperties/mergingcomplextypes/map/AcmeProperties.java +++ b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/externalconfig/typesafeconfigurationproperties/mergingcomplextypes/map/MyProperties.java @@ -21,8 +21,8 @@ import java.util.Map; import org.springframework.boot.context.properties.ConfigurationProperties; -@ConfigurationProperties("acme") -public class AcmeProperties { +@ConfigurationProperties("my") +public class MyProperties { private final Map map = new LinkedHashMap<>(); diff --git a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/externalconfig/typesafeconfigurationproperties/relaxedbinding/OwnerProperties.java b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/externalconfig/typesafeconfigurationproperties/relaxedbinding/MyPersonProperties.java similarity index 91% rename from spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/externalconfig/typesafeconfigurationproperties/relaxedbinding/OwnerProperties.java rename to spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/externalconfig/typesafeconfigurationproperties/relaxedbinding/MyPersonProperties.java index 8b945cc055..74fb9d6bd5 100644 --- a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/externalconfig/typesafeconfigurationproperties/relaxedbinding/OwnerProperties.java +++ b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/externalconfig/typesafeconfigurationproperties/relaxedbinding/MyPersonProperties.java @@ -18,8 +18,8 @@ package org.springframework.boot.docs.features.externalconfig.typesafeconfigurat import org.springframework.boot.context.properties.ConfigurationProperties; -@ConfigurationProperties(prefix = "acme.my-project.person") -public class OwnerProperties { +@ConfigurationProperties(prefix = "my.main-project.person") +public class MyPersonProperties { private String firstName; diff --git a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/externalconfig/typesafeconfigurationproperties/usingannotatedtypes/MyService.java b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/externalconfig/typesafeconfigurationproperties/usingannotatedtypes/MyService.java index 9dc5bb04c4..dfd2904d48 100644 --- a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/externalconfig/typesafeconfigurationproperties/usingannotatedtypes/MyService.java +++ b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/externalconfig/typesafeconfigurationproperties/usingannotatedtypes/MyService.java @@ -21,9 +21,9 @@ import org.springframework.stereotype.Service; @Service public class MyService { - private final AcmeProperties properties; + private final SomeProperties properties; - public MyService(AcmeProperties properties) { + public MyService(SomeProperties properties) { this.properties = properties; } diff --git a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/externalconfig/typesafeconfigurationproperties/usingannotatedtypes/AcmeProperties.java b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/externalconfig/typesafeconfigurationproperties/usingannotatedtypes/SomeProperties.java similarity index 97% rename from spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/externalconfig/typesafeconfigurationproperties/usingannotatedtypes/AcmeProperties.java rename to spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/externalconfig/typesafeconfigurationproperties/usingannotatedtypes/SomeProperties.java index 044ae6ef6e..cf46da4cff 100644 --- a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/externalconfig/typesafeconfigurationproperties/usingannotatedtypes/AcmeProperties.java +++ b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/externalconfig/typesafeconfigurationproperties/usingannotatedtypes/SomeProperties.java @@ -16,7 +16,7 @@ package org.springframework.boot.docs.features.externalconfig.typesafeconfigurationproperties.usingannotatedtypes; -class AcmeProperties { +class SomeProperties { Object getRemoteAddress() { return null; diff --git a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/externalconfig/typesafeconfigurationproperties/validate/AcmeProperties.java b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/externalconfig/typesafeconfigurationproperties/validate/MyProperties.java similarity index 94% rename from spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/externalconfig/typesafeconfigurationproperties/validate/AcmeProperties.java rename to spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/externalconfig/typesafeconfigurationproperties/validate/MyProperties.java index 440ddee7b8..138b8d4ecc 100644 --- a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/externalconfig/typesafeconfigurationproperties/validate/AcmeProperties.java +++ b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/externalconfig/typesafeconfigurationproperties/validate/MyProperties.java @@ -23,9 +23,9 @@ import javax.validation.constraints.NotNull; import org.springframework.boot.context.properties.ConfigurationProperties; import org.springframework.validation.annotation.Validated; -@ConfigurationProperties(prefix = "acme") +@ConfigurationProperties("my.service") @Validated -public class AcmeProperties { +public class MyProperties { @NotNull private InetAddress remoteAddress; diff --git a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/externalconfig/typesafeconfigurationproperties/validate/nested/AcmeProperties.java b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/externalconfig/typesafeconfigurationproperties/validate/nested/MyProperties.java similarity index 95% rename from spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/externalconfig/typesafeconfigurationproperties/validate/nested/AcmeProperties.java rename to spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/externalconfig/typesafeconfigurationproperties/validate/nested/MyProperties.java index c4fcb1379d..fd87eeaf46 100644 --- a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/externalconfig/typesafeconfigurationproperties/validate/nested/AcmeProperties.java +++ b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/externalconfig/typesafeconfigurationproperties/validate/nested/MyProperties.java @@ -25,9 +25,9 @@ import javax.validation.constraints.NotNull; import org.springframework.boot.context.properties.ConfigurationProperties; import org.springframework.validation.annotation.Validated; -@ConfigurationProperties(prefix = "acme") +@ConfigurationProperties("my.service") @Validated -public class AcmeProperties { +public class MyProperties { @NotNull private InetAddress remoteAddress; diff --git a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/messaging/amqp/receiving/custom/RabbitConfiguration.java b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/messaging/amqp/receiving/custom/MyRabbitConfiguration.java similarity index 97% rename from spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/messaging/amqp/receiving/custom/RabbitConfiguration.java rename to spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/messaging/amqp/receiving/custom/MyRabbitConfiguration.java index facc804104..74d7064f45 100644 --- a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/messaging/amqp/receiving/custom/RabbitConfiguration.java +++ b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/messaging/amqp/receiving/custom/MyRabbitConfiguration.java @@ -23,7 +23,7 @@ import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; @Configuration(proxyBeanMethods = false) -public class RabbitConfiguration { +public class MyRabbitConfiguration { @Bean public SimpleRabbitListenerContainerFactory myFactory(SimpleRabbitListenerContainerFactoryConfigurer configurer) { diff --git a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/messaging/jms/receiving/custom/JmsConfiguration.java b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/messaging/jms/receiving/custom/MyJmsConfiguration.java similarity index 97% rename from spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/messaging/jms/receiving/custom/JmsConfiguration.java rename to spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/messaging/jms/receiving/custom/MyJmsConfiguration.java index bd1efd67f1..1781fc3254 100644 --- a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/messaging/jms/receiving/custom/JmsConfiguration.java +++ b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/messaging/jms/receiving/custom/MyJmsConfiguration.java @@ -24,7 +24,7 @@ import org.springframework.context.annotation.Configuration; import org.springframework.jms.config.DefaultJmsListenerContainerFactory; @Configuration(proxyBeanMethods = false) -public class JmsConfiguration { +public class MyJmsConfiguration { @Bean public DefaultJmsListenerContainerFactory myFactory(DefaultJmsListenerContainerFactoryConfigurer configurer) { diff --git a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/messaging/kafka/embedded/annotation/MyTest.java b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/messaging/kafka/embedded/annotation/MyTest.java index 45251da820..64faa56163 100644 --- a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/messaging/kafka/embedded/annotation/MyTest.java +++ b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/messaging/kafka/embedded/annotation/MyTest.java @@ -21,7 +21,7 @@ import org.springframework.kafka.test.context.EmbeddedKafka; @SpringBootTest @EmbeddedKafka(topics = "someTopic", bootstrapServersProperty = "spring.kafka.bootstrap-servers") -public class MyTest { +class MyTest { // ... diff --git a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/messaging/kafka/embedded/property/MyTest.java b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/messaging/kafka/embedded/property/MyTest.java index 5fbe583a2f..fb186d5ae3 100644 --- a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/messaging/kafka/embedded/property/MyTest.java +++ b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/messaging/kafka/embedded/property/MyTest.java @@ -20,7 +20,7 @@ import org.springframework.boot.test.context.SpringBootTest; import org.springframework.kafka.test.EmbeddedKafkaBroker; @SpringBootTest -public class MyTest { +class MyTest { // tag::code[] static { diff --git a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/messaging/kafka/sending/MyBean.java b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/messaging/kafka/sending/MyBean.java index 207cc0b789..f01737e6f6 100644 --- a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/messaging/kafka/sending/MyBean.java +++ b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/messaging/kafka/sending/MyBean.java @@ -16,7 +16,6 @@ package org.springframework.boot.docs.features.messaging.kafka.sending; -import org.springframework.beans.factory.annotation.Autowired; import org.springframework.kafka.core.KafkaTemplate; import org.springframework.stereotype.Component; @@ -25,7 +24,6 @@ public class MyBean { private final KafkaTemplate kafkaTemplate; - @Autowired public MyBean(KafkaTemplate kafkaTemplate) { this.kafkaTemplate = kafkaTemplate; } diff --git a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/messaging/kafka/streams/KafkaStreamsConfiguration.java b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/messaging/kafka/streams/MyKafkaStreamsConfiguration.java similarity index 97% rename from spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/messaging/kafka/streams/KafkaStreamsConfiguration.java rename to spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/messaging/kafka/streams/MyKafkaStreamsConfiguration.java index 0915761292..850c1a8f46 100644 --- a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/messaging/kafka/streams/KafkaStreamsConfiguration.java +++ b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/messaging/kafka/streams/MyKafkaStreamsConfiguration.java @@ -29,7 +29,7 @@ import org.springframework.kafka.support.serializer.JsonSerde; @Configuration(proxyBeanMethods = false) @EnableKafkaStreams -public class KafkaStreamsConfiguration { +public class MyKafkaStreamsConfiguration { @Bean public KStream kStream(StreamsBuilder streamsBuilder) { diff --git a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/nosql/couchbase/repositories/CouchbaseConversionsConfiguration.java b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/nosql/couchbase/repositories/MyCouchbaseConfiguration.java similarity index 96% rename from spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/nosql/couchbase/repositories/CouchbaseConversionsConfiguration.java rename to spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/nosql/couchbase/repositories/MyCouchbaseConfiguration.java index 2e68789ff4..39b294b53a 100644 --- a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/nosql/couchbase/repositories/CouchbaseConversionsConfiguration.java +++ b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/nosql/couchbase/repositories/MyCouchbaseConfiguration.java @@ -24,7 +24,7 @@ import org.springframework.data.couchbase.config.BeanNames; import org.springframework.data.couchbase.core.convert.CouchbaseCustomConversions; @Configuration(proxyBeanMethods = false) -public class CouchbaseConversionsConfiguration { +public class MyCouchbaseConfiguration { @Bean(BeanNames.COUCHBASE_CUSTOM_CONVERSIONS) public CouchbaseCustomConversions myCustomConversions() { diff --git a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/nosql/neo4j/repositories/Neo4jReactiveTransactionManagerConfiguration.java b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/nosql/neo4j/repositories/MyNeo4jConfiguration.java similarity index 95% rename from spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/nosql/neo4j/repositories/Neo4jReactiveTransactionManagerConfiguration.java rename to spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/nosql/neo4j/repositories/MyNeo4jConfiguration.java index 7f17aeb769..f9ee179f57 100644 --- a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/nosql/neo4j/repositories/Neo4jReactiveTransactionManagerConfiguration.java +++ b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/nosql/neo4j/repositories/MyNeo4jConfiguration.java @@ -24,7 +24,7 @@ import org.springframework.data.neo4j.core.ReactiveDatabaseSelectionProvider; import org.springframework.data.neo4j.core.transaction.ReactiveNeo4jTransactionManager; @Configuration(proxyBeanMethods = false) -public class Neo4jReactiveTransactionManagerConfiguration { +public class MyNeo4jConfiguration { @Bean public ReactiveNeo4jTransactionManager reactiveTransactionManager(Driver driver, diff --git a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/nosql/redis/connecting/MyBean.java b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/nosql/redis/connecting/MyBean.java index fbfd617e11..0e1506dd49 100644 --- a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/nosql/redis/connecting/MyBean.java +++ b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/nosql/redis/connecting/MyBean.java @@ -22,7 +22,7 @@ import org.springframework.stereotype.Component; @Component public class MyBean { - private StringRedisTemplate template; + private final StringRedisTemplate template; public MyBean(StringRedisTemplate template) { this.template = template; diff --git a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/nosql/solr/connecting/MyBean.java b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/nosql/solr/connecting/MyBean.java index 11bdccde03..8bdbd28c7d 100644 --- a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/nosql/solr/connecting/MyBean.java +++ b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/nosql/solr/connecting/MyBean.java @@ -27,7 +27,7 @@ import org.springframework.stereotype.Component; @Component public class MyBean { - private SolrClient solr; + private final SolrClient solr; public MyBean(SolrClient solr) { this.solr = solr; diff --git a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/quartz/SampleJob.java b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/quartz/MySampleJob.java similarity index 96% rename from spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/quartz/SampleJob.java rename to spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/quartz/MySampleJob.java index 491a44b280..9a74343c7b 100644 --- a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/quartz/SampleJob.java +++ b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/quartz/MySampleJob.java @@ -21,7 +21,7 @@ import org.quartz.JobExecutionException; import org.springframework.scheduling.quartz.QuartzJobBean; -public class SampleJob extends QuartzJobBean { +public class MySampleJob extends QuartzJobBean { // @fold:on // fields ... private MyService myService; diff --git a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/resttemplate/customization/RestTemplateBuilderConfiguration.java b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/resttemplate/customization/MyRestTemplateBuilderConfiguration.java similarity index 96% rename from spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/resttemplate/customization/RestTemplateBuilderConfiguration.java rename to spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/resttemplate/customization/MyRestTemplateBuilderConfiguration.java index 2110bf023c..95f0dc7fc4 100644 --- a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/resttemplate/customization/RestTemplateBuilderConfiguration.java +++ b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/resttemplate/customization/MyRestTemplateBuilderConfiguration.java @@ -24,7 +24,7 @@ import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; @Configuration(proxyBeanMethods = false) -public class RestTemplateBuilderConfiguration { +public class MyRestTemplateBuilderConfiguration { @Bean public RestTemplateBuilder restTemplateBuilder(RestTemplateBuilderConfigurer configurer) { diff --git a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/resttemplate/customization/RestTemplateProxyCustomizer.java b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/resttemplate/customization/MyRestTemplateCustomizer.java similarity index 96% rename from spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/resttemplate/customization/RestTemplateProxyCustomizer.java rename to spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/resttemplate/customization/MyRestTemplateCustomizer.java index ad0bf293fb..0c09950c0c 100644 --- a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/resttemplate/customization/RestTemplateProxyCustomizer.java +++ b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/resttemplate/customization/MyRestTemplateCustomizer.java @@ -29,7 +29,7 @@ import org.springframework.boot.web.client.RestTemplateCustomizer; import org.springframework.http.client.HttpComponentsClientHttpRequestFactory; import org.springframework.web.client.RestTemplate; -public class RestTemplateProxyCustomizer implements RestTemplateCustomizer { +public class MyRestTemplateCustomizer implements RestTemplateCustomizer { @Override public void customize(RestTemplate restTemplate) { diff --git a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/security/oauth2/client/OAuthClientConfiguration.java b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/security/oauth2/client/MyOAuthClientConfiguration.java similarity index 93% rename from spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/security/oauth2/client/OAuthClientConfiguration.java rename to spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/security/oauth2/client/MyOAuthClientConfiguration.java index 65695c8ec1..6e15db5f2e 100644 --- a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/security/oauth2/client/OAuthClientConfiguration.java +++ b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/security/oauth2/client/MyOAuthClientConfiguration.java @@ -21,8 +21,8 @@ import org.springframework.context.annotation.Configuration; import org.springframework.security.config.annotation.web.builders.HttpSecurity; import org.springframework.security.web.SecurityFilterChain; -@Configuration -public class OAuthClientConfiguration { +@Configuration(proxyBeanMethods = false) +public class MyOAuthClientConfiguration { @Bean public SecurityFilterChain securityFilterChain(HttpSecurity http) throws Exception { diff --git a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/security/springwebflux/CustomWebFluxSecurityConfiguration.java b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/security/springwebflux/MyWebFluxSecurityConfiguration.java similarity index 96% rename from spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/security/springwebflux/CustomWebFluxSecurityConfiguration.java rename to spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/security/springwebflux/MyWebFluxSecurityConfiguration.java index 9f5268f4f8..05dca638ec 100644 --- a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/security/springwebflux/CustomWebFluxSecurityConfiguration.java +++ b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/security/springwebflux/MyWebFluxSecurityConfiguration.java @@ -23,7 +23,7 @@ import org.springframework.security.config.web.server.ServerHttpSecurity; import org.springframework.security.web.server.SecurityWebFilterChain; @Configuration(proxyBeanMethods = false) -public class CustomWebFluxSecurityConfiguration { +public class MyWebFluxSecurityConfiguration { @Bean public SecurityWebFilterChain springSecurityFilterChain(ServerHttpSecurity http) { diff --git a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/springapplication/applicationarguments/ApplicationArgumentsExample.java b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/springapplication/applicationarguments/MyBean.java similarity index 90% rename from spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/springapplication/applicationarguments/ApplicationArgumentsExample.java rename to spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/springapplication/applicationarguments/MyBean.java index 1ab87a57e1..a1f5f99a67 100644 --- a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/springapplication/applicationarguments/ApplicationArgumentsExample.java +++ b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/springapplication/applicationarguments/MyBean.java @@ -22,9 +22,9 @@ import org.springframework.boot.ApplicationArguments; import org.springframework.stereotype.Component; @Component -public class ApplicationArgumentsExample { +public class MyBean { - public ApplicationArgumentsExample(ApplicationArguments args) { + public MyBean(ApplicationArguments args) { boolean debug = args.containsOption("debug"); List files = args.getNonOptionArgs(); if (debug) { diff --git a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/springapplication/applicationavailability/managing/LocalCacheVerifier.java b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/springapplication/applicationavailability/managing/MyLocalCacheVerifier.java similarity index 92% rename from spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/springapplication/applicationavailability/managing/LocalCacheVerifier.java rename to spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/springapplication/applicationavailability/managing/MyLocalCacheVerifier.java index 222c44e2a7..7debf1c67a 100644 --- a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/springapplication/applicationavailability/managing/LocalCacheVerifier.java +++ b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/springapplication/applicationavailability/managing/MyLocalCacheVerifier.java @@ -22,11 +22,11 @@ import org.springframework.context.ApplicationEventPublisher; import org.springframework.stereotype.Component; @Component -public class LocalCacheVerifier { +public class MyLocalCacheVerifier { private final ApplicationEventPublisher eventPublisher; - public LocalCacheVerifier(ApplicationEventPublisher eventPublisher) { + public MyLocalCacheVerifier(ApplicationEventPublisher eventPublisher) { this.eventPublisher = eventPublisher; } diff --git a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/springapplication/applicationavailability/managing/ReadinessStateExporter.java b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/springapplication/applicationavailability/managing/MyReadinessStateExporter.java similarity index 96% rename from spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/springapplication/applicationavailability/managing/ReadinessStateExporter.java rename to spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/springapplication/applicationavailability/managing/MyReadinessStateExporter.java index 6f66c4c4f4..db7127eec2 100644 --- a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/springapplication/applicationavailability/managing/ReadinessStateExporter.java +++ b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/springapplication/applicationavailability/managing/MyReadinessStateExporter.java @@ -22,7 +22,7 @@ import org.springframework.context.event.EventListener; import org.springframework.stereotype.Component; @Component -public class ReadinessStateExporter { +public class MyReadinessStateExporter { @EventListener public void onStateChange(AvailabilityChangeEvent event) { diff --git a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/springapplication/commandlinerunner/CommandLineRunnerExample.java b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/springapplication/commandlinerunner/MyCommandLineRunner.java similarity index 92% rename from spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/springapplication/commandlinerunner/CommandLineRunnerExample.java rename to spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/springapplication/commandlinerunner/MyCommandLineRunner.java index e7dc632fe5..953d69dcc8 100644 --- a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/springapplication/commandlinerunner/CommandLineRunnerExample.java +++ b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/springapplication/commandlinerunner/MyCommandLineRunner.java @@ -20,7 +20,7 @@ import org.springframework.boot.CommandLineRunner; import org.springframework.stereotype.Component; @Component -public class CommandLineRunnerExample implements CommandLineRunner { +public class MyCommandLineRunner implements CommandLineRunner { @Override public void run(String... args) { diff --git a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/springapplication/fluentbuilderapi/SpringApplicationBuilderExample.java b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/springapplication/fluentbuilderapi/MyApplication.java similarity index 96% rename from spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/springapplication/fluentbuilderapi/SpringApplicationBuilderExample.java rename to spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/springapplication/fluentbuilderapi/MyApplication.java index d0f6ea8d3a..0ef7f8ed42 100644 --- a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/springapplication/fluentbuilderapi/SpringApplicationBuilderExample.java +++ b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/springapplication/fluentbuilderapi/MyApplication.java @@ -19,7 +19,7 @@ package org.springframework.boot.docs.features.springapplication.fluentbuilderap import org.springframework.boot.Banner; import org.springframework.boot.builder.SpringApplicationBuilder; -public class SpringApplicationBuilderExample { +public class MyApplication { public void hierarchyWithDisabledBanner(String[] args) { // @formatter:off diff --git a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/sql/jooq/dslcontext/JooqExample.java b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/sql/jooq/dslcontext/MyBean.java similarity index 94% rename from spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/sql/jooq/dslcontext/JooqExample.java rename to spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/sql/jooq/dslcontext/MyBean.java index 8a5efff54b..7e4eb66cd0 100644 --- a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/sql/jooq/dslcontext/JooqExample.java +++ b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/sql/jooq/dslcontext/MyBean.java @@ -26,11 +26,11 @@ import org.springframework.stereotype.Component; import static org.springframework.boot.docs.features.sql.jooq.dslcontext.Tables.AUTHOR; @Component -public class JooqExample { +public class MyBean { private final DSLContext create; - public JooqExample(DSLContext dslContext) { + public MyBean(DSLContext dslContext) { this.create = dslContext; } diff --git a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/sql/r2dbc/CustomizeR2dbcPostgresOptionsConfiguration.java b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/sql/r2dbc/MyPostgresR2dbcConfiguration.java similarity index 92% rename from spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/sql/r2dbc/CustomizeR2dbcPostgresOptionsConfiguration.java rename to spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/sql/r2dbc/MyPostgresR2dbcConfiguration.java index 231a8ff76b..5e64e08cc8 100644 --- a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/sql/r2dbc/CustomizeR2dbcPostgresOptionsConfiguration.java +++ b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/sql/r2dbc/MyPostgresR2dbcConfiguration.java @@ -25,10 +25,9 @@ import org.springframework.boot.autoconfigure.r2dbc.ConnectionFactoryOptionsBuil import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; -@Configuration -public class CustomizeR2dbcPostgresOptionsConfiguration { +@Configuration(proxyBeanMethods = false) +public class MyPostgresR2dbcConfiguration { - // tag::code[] @Bean public ConnectionFactoryOptionsBuilderCustomizer postgresCustomizer() { Map options = new HashMap<>(); @@ -36,6 +35,5 @@ public class CustomizeR2dbcPostgresOptionsConfiguration { options.put("statement_timeout", "60s"); return (builder) -> builder.option(PostgresqlConnectionFactoryProvider.OPTIONS, options); } - // end::code[] } diff --git a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/sql/r2dbc/MyR2dbcPortConfiguration.java b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/sql/r2dbc/MyR2dbcConfiguration.java similarity index 93% rename from spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/sql/r2dbc/MyR2dbcPortConfiguration.java rename to spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/sql/r2dbc/MyR2dbcConfiguration.java index 2aea8e7360..09483ad340 100644 --- a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/sql/r2dbc/MyR2dbcPortConfiguration.java +++ b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/sql/r2dbc/MyR2dbcConfiguration.java @@ -22,8 +22,8 @@ import org.springframework.boot.autoconfigure.r2dbc.ConnectionFactoryOptionsBuil import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; -@Configuration -public class MyR2dbcPortConfiguration { +@Configuration(proxyBeanMethods = false) +public class MyR2dbcConfiguration { @Bean public ConnectionFactoryOptionsBuilderCustomizer connectionFactoryPortCustomizer() { diff --git a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/testing/springbootapplications/additionalautoconfigurationandslicing/ExampleJdbcTests.java b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/testing/springbootapplications/additionalautoconfigurationandslicing/MyJdbcTests.java similarity index 97% rename from spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/testing/springbootapplications/additionalautoconfigurationandslicing/ExampleJdbcTests.java rename to spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/testing/springbootapplications/additionalautoconfigurationandslicing/MyJdbcTests.java index 762126caad..4db7086023 100644 --- a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/testing/springbootapplications/additionalautoconfigurationandslicing/ExampleJdbcTests.java +++ b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/testing/springbootapplications/additionalautoconfigurationandslicing/MyJdbcTests.java @@ -22,6 +22,6 @@ import org.springframework.boot.test.autoconfigure.jdbc.JdbcTest; @JdbcTest @ImportAutoConfiguration(IntegrationAutoConfiguration.class) -class ExampleJdbcTests { +class MyJdbcTests { } diff --git a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/testing/springbootapplications/autoconfiguredspringrestdocs/withmockmvc/CustomizationConfiguration.java b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/testing/springbootapplications/autoconfiguredspringrestdocs/withmockmvc/MyRestDocsConfiguration.java similarity index 90% rename from spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/testing/springbootapplications/autoconfiguredspringrestdocs/withmockmvc/CustomizationConfiguration.java rename to spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/testing/springbootapplications/autoconfiguredspringrestdocs/withmockmvc/MyRestDocsConfiguration.java index a2afa03851..e1bf3b1b5d 100644 --- a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/testing/springbootapplications/autoconfiguredspringrestdocs/withmockmvc/CustomizationConfiguration.java +++ b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/testing/springbootapplications/autoconfiguredspringrestdocs/withmockmvc/MyRestDocsConfiguration.java @@ -21,8 +21,8 @@ import org.springframework.boot.test.context.TestConfiguration; import org.springframework.restdocs.mockmvc.MockMvcRestDocumentationConfigurer; import org.springframework.restdocs.templates.TemplateFormats; -@TestConfiguration -public class CustomizationConfiguration implements RestDocsMockMvcConfigurationCustomizer { +@TestConfiguration(proxyBeanMethods = false) +public class MyRestDocsConfiguration implements RestDocsMockMvcConfigurationCustomizer { @Override public void customize(MockMvcRestDocumentationConfigurer configurer) { diff --git a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/testing/springbootapplications/autoconfiguredspringrestdocs/withmockmvc/ResultHandlerConfiguration.java b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/testing/springbootapplications/autoconfiguredspringrestdocs/withmockmvc/MyResultHandlerConfiguration.java similarity index 96% rename from spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/testing/springbootapplications/autoconfiguredspringrestdocs/withmockmvc/ResultHandlerConfiguration.java rename to spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/testing/springbootapplications/autoconfiguredspringrestdocs/withmockmvc/MyResultHandlerConfiguration.java index 6eef331a26..e0b9839f08 100644 --- a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/testing/springbootapplications/autoconfiguredspringrestdocs/withmockmvc/ResultHandlerConfiguration.java +++ b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/testing/springbootapplications/autoconfiguredspringrestdocs/withmockmvc/MyResultHandlerConfiguration.java @@ -22,7 +22,7 @@ import org.springframework.restdocs.mockmvc.MockMvcRestDocumentation; import org.springframework.restdocs.mockmvc.RestDocumentationResultHandler; @TestConfiguration(proxyBeanMethods = false) -public class ResultHandlerConfiguration { +public class MyResultHandlerConfiguration { @Bean public RestDocumentationResultHandler restDocumentation() { diff --git a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/testing/springbootapplications/autoconfiguredspringrestdocs/withmockmvc/UserDocumentationTests.java b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/testing/springbootapplications/autoconfiguredspringrestdocs/withmockmvc/MyUserDocumentationTests.java similarity index 98% rename from spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/testing/springbootapplications/autoconfiguredspringrestdocs/withmockmvc/UserDocumentationTests.java rename to spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/testing/springbootapplications/autoconfiguredspringrestdocs/withmockmvc/MyUserDocumentationTests.java index fa8d920efc..5e26ca555c 100644 --- a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/testing/springbootapplications/autoconfiguredspringrestdocs/withmockmvc/UserDocumentationTests.java +++ b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/testing/springbootapplications/autoconfiguredspringrestdocs/withmockmvc/MyUserDocumentationTests.java @@ -30,7 +30,7 @@ import static org.springframework.test.web.servlet.result.MockMvcResultMatchers. @WebMvcTest(UserController.class) @AutoConfigureRestDocs -class UserDocumentationTests { +class MyUserDocumentationTests { @Autowired private MockMvc mvc; diff --git a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/testing/springbootapplications/autoconfiguredspringrestdocs/withrestassured/AdvancedRestDocsConfiguration.java b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/testing/springbootapplications/autoconfiguredspringrestdocs/withrestassured/MyRestDocsConfiguration.java similarity index 92% rename from spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/testing/springbootapplications/autoconfiguredspringrestdocs/withrestassured/AdvancedRestDocsConfiguration.java rename to spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/testing/springbootapplications/autoconfiguredspringrestdocs/withrestassured/MyRestDocsConfiguration.java index 6d011721eb..f83b77190b 100644 --- a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/testing/springbootapplications/autoconfiguredspringrestdocs/withrestassured/AdvancedRestDocsConfiguration.java +++ b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/testing/springbootapplications/autoconfiguredspringrestdocs/withrestassured/MyRestDocsConfiguration.java @@ -22,7 +22,7 @@ import org.springframework.restdocs.restassured3.RestAssuredRestDocumentationCon import org.springframework.restdocs.templates.TemplateFormats; @TestConfiguration(proxyBeanMethods = false) -public class AdvancedRestDocsConfiguration implements RestDocsRestAssuredConfigurationCustomizer { +public class MyRestDocsConfiguration implements RestDocsRestAssuredConfigurationCustomizer { @Override public void customize(RestAssuredRestDocumentationConfigurer configurer) { diff --git a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/testing/springbootapplications/autoconfiguredspringrestdocs/withrestassured/UserDocumentationTests.java b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/testing/springbootapplications/autoconfiguredspringrestdocs/withrestassured/MyUserDocumentationTests.java similarity index 98% rename from spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/testing/springbootapplications/autoconfiguredspringrestdocs/withrestassured/UserDocumentationTests.java rename to spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/testing/springbootapplications/autoconfiguredspringrestdocs/withrestassured/MyUserDocumentationTests.java index eac2836a42..9f969cf180 100644 --- a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/testing/springbootapplications/autoconfiguredspringrestdocs/withrestassured/UserDocumentationTests.java +++ b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/testing/springbootapplications/autoconfiguredspringrestdocs/withrestassured/MyUserDocumentationTests.java @@ -31,7 +31,7 @@ import static org.springframework.restdocs.restassured3.RestAssuredRestDocumenta @SpringBootTest(webEnvironment = WebEnvironment.RANDOM_PORT) @AutoConfigureRestDocs -class UserDocumentationTests { +class MyUserDocumentationTests { @Test void listUsers(@Autowired RequestSpecification documentationSpec, @LocalServerPort int port) { diff --git a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/testing/springbootapplications/autoconfiguredspringrestdocs/withwebtestclient/AdvancedRestDocsConfiguration.java b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/testing/springbootapplications/autoconfiguredspringrestdocs/withwebtestclient/MyRestDocsConfiguration.java similarity index 92% rename from spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/testing/springbootapplications/autoconfiguredspringrestdocs/withwebtestclient/AdvancedRestDocsConfiguration.java rename to spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/testing/springbootapplications/autoconfiguredspringrestdocs/withwebtestclient/MyRestDocsConfiguration.java index 19a1c8ed1b..b1d7694ceb 100644 --- a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/testing/springbootapplications/autoconfiguredspringrestdocs/withwebtestclient/AdvancedRestDocsConfiguration.java +++ b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/testing/springbootapplications/autoconfiguredspringrestdocs/withwebtestclient/MyRestDocsConfiguration.java @@ -21,7 +21,7 @@ import org.springframework.boot.test.context.TestConfiguration; import org.springframework.restdocs.webtestclient.WebTestClientRestDocumentationConfigurer; @TestConfiguration(proxyBeanMethods = false) -public class AdvancedRestDocsConfiguration implements RestDocsWebTestClientConfigurationCustomizer { +public class MyRestDocsConfiguration implements RestDocsWebTestClientConfigurationCustomizer { @Override public void customize(WebTestClientRestDocumentationConfigurer configurer) { diff --git a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/testing/springbootapplications/autoconfiguredspringrestdocs/withwebtestclient/UsersDocumentationTests.java b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/testing/springbootapplications/autoconfiguredspringrestdocs/withwebtestclient/MyUsersDocumentationTests.java similarity index 97% rename from spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/testing/springbootapplications/autoconfiguredspringrestdocs/withwebtestclient/UsersDocumentationTests.java rename to spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/testing/springbootapplications/autoconfiguredspringrestdocs/withwebtestclient/MyUsersDocumentationTests.java index 886ed4f466..a83b763b94 100644 --- a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/testing/springbootapplications/autoconfiguredspringrestdocs/withwebtestclient/UsersDocumentationTests.java +++ b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/testing/springbootapplications/autoconfiguredspringrestdocs/withwebtestclient/MyUsersDocumentationTests.java @@ -27,7 +27,7 @@ import static org.springframework.restdocs.webtestclient.WebTestClientRestDocume @WebFluxTest @AutoConfigureRestDocs -class UsersDocumentationTests { +class MyUsersDocumentationTests { @Autowired private WebTestClient webTestClient; diff --git a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/testing/springbootapplications/jmx/SampleJmxTests.java b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/testing/springbootapplications/jmx/MyJmxTests.java similarity index 98% rename from spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/testing/springbootapplications/jmx/SampleJmxTests.java rename to spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/testing/springbootapplications/jmx/MyJmxTests.java index f35b5a6db5..ba544a77c2 100644 --- a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/testing/springbootapplications/jmx/SampleJmxTests.java +++ b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/testing/springbootapplications/jmx/MyJmxTests.java @@ -32,7 +32,7 @@ import static org.assertj.core.api.Assertions.assertThat; @ExtendWith(SpringExtension.class) @SpringBootTest(properties = "spring.jmx.enabled=true") @DirtiesContext -class SampleJmxTests { +class MyJmxTests { @Autowired private MBeanServer mBeanServer; diff --git a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/testing/springbootapplications/jsontests/AssertJ.java b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/testing/springbootapplications/jsontests/MyJsonAssertJTests.java similarity index 98% rename from spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/testing/springbootapplications/jsontests/AssertJ.java rename to spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/testing/springbootapplications/jsontests/MyJsonAssertJTests.java index a170dfc821..3f108b5205 100644 --- a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/testing/springbootapplications/jsontests/AssertJ.java +++ b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/testing/springbootapplications/jsontests/MyJsonAssertJTests.java @@ -26,7 +26,7 @@ import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.within; @JsonTest -class AssertJ { +class MyJsonAssertJTests { @Autowired private JacksonTester json; diff --git a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/testing/springbootapplications/mockingbeans/listener/MyTests.java b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/testing/springbootapplications/mockingbeans/listener/MyTests.java index f919bf6f75..66f43b2f3d 100644 --- a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/testing/springbootapplications/mockingbeans/listener/MyTests.java +++ b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/testing/springbootapplications/mockingbeans/listener/MyTests.java @@ -23,7 +23,7 @@ import org.springframework.test.context.TestExecutionListeners; @ContextConfiguration(classes = MyConfig.class) @TestExecutionListeners({ MockitoTestExecutionListener.class, ResetMocksTestExecutionListener.class }) -public class MyTests { +class MyTests { // ... diff --git a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/testing/springbootapplications/userconfigurationandslicing/SampleApplication.java b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/testing/springbootapplications/userconfigurationandslicing/MyApplication.java similarity index 96% rename from spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/testing/springbootapplications/userconfigurationandslicing/SampleApplication.java rename to spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/testing/springbootapplications/userconfigurationandslicing/MyApplication.java index d61b08edb7..163a225c03 100644 --- a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/testing/springbootapplications/userconfigurationandslicing/SampleApplication.java +++ b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/testing/springbootapplications/userconfigurationandslicing/MyApplication.java @@ -21,7 +21,7 @@ import org.springframework.boot.autoconfigure.SpringBootApplication; @SpringBootApplication @EnableBatchProcessing -public class SampleApplication { +public class MyApplication { // ... diff --git a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/testing/springbootapplications/userconfigurationandslicing/BatchConfiguration.java b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/testing/springbootapplications/userconfigurationandslicing/MyBatchConfiguration.java similarity index 96% rename from spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/testing/springbootapplications/userconfigurationandslicing/BatchConfiguration.java rename to spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/testing/springbootapplications/userconfigurationandslicing/MyBatchConfiguration.java index 48f5deac76..67ee08b8bc 100644 --- a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/testing/springbootapplications/userconfigurationandslicing/BatchConfiguration.java +++ b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/testing/springbootapplications/userconfigurationandslicing/MyBatchConfiguration.java @@ -21,7 +21,7 @@ import org.springframework.context.annotation.Configuration; @Configuration(proxyBeanMethods = false) @EnableBatchProcessing -public class BatchConfiguration { +public class MyBatchConfiguration { // ... diff --git a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/testing/springbootapplications/userconfigurationandslicing/WebConfiguration.java b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/testing/springbootapplications/userconfigurationandslicing/MyWebConfiguration.java similarity index 93% rename from spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/testing/springbootapplications/userconfigurationandslicing/WebConfiguration.java rename to spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/testing/springbootapplications/userconfigurationandslicing/MyWebConfiguration.java index 67d4370055..108413919d 100644 --- a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/testing/springbootapplications/userconfigurationandslicing/WebConfiguration.java +++ b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/testing/springbootapplications/userconfigurationandslicing/MyWebConfiguration.java @@ -20,8 +20,8 @@ import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; -@Configuration -public class WebConfiguration { +@Configuration(proxyBeanMethods = false) +public class MyWebConfiguration { @Bean public WebMvcConfigurer testConfigurer() { diff --git a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/testing/springbootapplications/userconfigurationandslicing/TestWebMvcConfigurer.java b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/testing/springbootapplications/userconfigurationandslicing/MyWebMvcConfigurer.java similarity index 93% rename from spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/testing/springbootapplications/userconfigurationandslicing/TestWebMvcConfigurer.java rename to spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/testing/springbootapplications/userconfigurationandslicing/MyWebMvcConfigurer.java index e58f873c7a..bbe00937d1 100644 --- a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/testing/springbootapplications/userconfigurationandslicing/TestWebMvcConfigurer.java +++ b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/testing/springbootapplications/userconfigurationandslicing/MyWebMvcConfigurer.java @@ -20,7 +20,7 @@ import org.springframework.stereotype.Component; import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; @Component -public class TestWebMvcConfigurer implements WebMvcConfigurer { +public class MyWebMvcConfigurer implements WebMvcConfigurer { // ... diff --git a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/testing/springbootapplications/userconfigurationandslicing/scan/SampleApplication.java b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/testing/springbootapplications/userconfigurationandslicing/scan/MyApplication.java similarity index 90% rename from spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/testing/springbootapplications/userconfigurationandslicing/scan/SampleApplication.java rename to spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/testing/springbootapplications/userconfigurationandslicing/scan/MyApplication.java index 0e429a95e0..7f25126855 100644 --- a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/testing/springbootapplications/userconfigurationandslicing/scan/SampleApplication.java +++ b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/testing/springbootapplications/userconfigurationandslicing/scan/MyApplication.java @@ -20,8 +20,8 @@ import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.context.annotation.ComponentScan; @SpringBootApplication -@ComponentScan({ "com.example.app", "org.acme.another" }) -public class SampleApplication { +@ComponentScan({ "com.example.app", "com.example.another" }) +public class MyApplication { // ... diff --git a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/testing/springbootapplications/usingapplicationarguments/ApplicationArgumentTests.java b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/testing/springbootapplications/usingapplicationarguments/MyApplicationArgumentTests.java similarity index 97% rename from spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/testing/springbootapplications/usingapplicationarguments/ApplicationArgumentTests.java rename to spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/testing/springbootapplications/usingapplicationarguments/MyApplicationArgumentTests.java index 13fdac0579..c362c7ebf5 100644 --- a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/testing/springbootapplications/usingapplicationarguments/ApplicationArgumentTests.java +++ b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/testing/springbootapplications/usingapplicationarguments/MyApplicationArgumentTests.java @@ -25,7 +25,7 @@ import org.springframework.boot.test.context.SpringBootTest; import static org.assertj.core.api.Assertions.assertThat; @SpringBootTest(args = "--app.test=one") -class ApplicationArgumentTests { +class MyApplicationArgumentTests { @Test void applicationArgumentsPopulated(@Autowired ApplicationArguments args) { diff --git a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/testing/springbootapplications/withmockenvironment/MockMvcTests.java b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/testing/springbootapplications/withmockenvironment/MyMockMvcTests.java similarity index 98% rename from spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/testing/springbootapplications/withmockenvironment/MockMvcTests.java rename to spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/testing/springbootapplications/withmockenvironment/MyMockMvcTests.java index dd5d8fcf38..b89b927673 100644 --- a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/testing/springbootapplications/withmockenvironment/MockMvcTests.java +++ b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/testing/springbootapplications/withmockenvironment/MyMockMvcTests.java @@ -29,7 +29,7 @@ import static org.springframework.test.web.servlet.result.MockMvcResultMatchers. @SpringBootTest @AutoConfigureMockMvc -class MockMvcTests { +class MyMockMvcTests { @Test void exampleTest(@Autowired MockMvc mvc) throws Exception { diff --git a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/testing/springbootapplications/withmockenvironment/MockWebTestClientTests.java b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/testing/springbootapplications/withmockenvironment/MyMockWebTestClientTests.java similarity index 97% rename from spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/testing/springbootapplications/withmockenvironment/MockWebTestClientTests.java rename to spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/testing/springbootapplications/withmockenvironment/MyMockWebTestClientTests.java index 0348963f8e..4fcd698b73 100644 --- a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/testing/springbootapplications/withmockenvironment/MockWebTestClientTests.java +++ b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/testing/springbootapplications/withmockenvironment/MyMockWebTestClientTests.java @@ -25,7 +25,7 @@ import org.springframework.test.web.reactive.server.WebTestClient; @SpringBootTest @AutoConfigureWebTestClient -class MockWebTestClientTests { +class MyMockWebTestClientTests { @Test void exampleTest(@Autowired WebTestClient webClient) { diff --git a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/testing/springbootapplications/withrunningserver/RandomPortTestRestTemplateTests.java b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/testing/springbootapplications/withrunningserver/MyRandomPortTestRestTemplateTests.java similarity index 96% rename from spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/testing/springbootapplications/withrunningserver/RandomPortTestRestTemplateTests.java rename to spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/testing/springbootapplications/withrunningserver/MyRandomPortTestRestTemplateTests.java index 14701eab57..8ed9f3f416 100644 --- a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/testing/springbootapplications/withrunningserver/RandomPortTestRestTemplateTests.java +++ b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/testing/springbootapplications/withrunningserver/MyRandomPortTestRestTemplateTests.java @@ -26,7 +26,7 @@ import org.springframework.boot.test.web.client.TestRestTemplate; import static org.assertj.core.api.Assertions.assertThat; @SpringBootTest(webEnvironment = WebEnvironment.RANDOM_PORT) -class RandomPortTestRestTemplateTests { +class MyRandomPortTestRestTemplateTests { @Test void exampleTest(@Autowired TestRestTemplate restTemplate) { diff --git a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/testing/springbootapplications/withrunningserver/RandomPortWebTestClientTests.java b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/testing/springbootapplications/withrunningserver/MyRandomPortWebTestClientTests.java similarity index 97% rename from spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/testing/springbootapplications/withrunningserver/RandomPortWebTestClientTests.java rename to spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/testing/springbootapplications/withrunningserver/MyRandomPortWebTestClientTests.java index 30550081d0..c7f660b67d 100644 --- a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/testing/springbootapplications/withrunningserver/RandomPortWebTestClientTests.java +++ b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/testing/springbootapplications/withrunningserver/MyRandomPortWebTestClientTests.java @@ -24,7 +24,7 @@ import org.springframework.boot.test.context.SpringBootTest.WebEnvironment; import org.springframework.test.web.reactive.server.WebTestClient; @SpringBootTest(webEnvironment = WebEnvironment.RANDOM_PORT) -class RandomPortWebTestClientTests { +class MyRandomPortWebTestClientTests { @Test void exampleTest(@Autowired WebTestClient webClient) { diff --git a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/testing/utilities/outputcapture/OutputCaptureTests.java b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/testing/utilities/outputcapture/MyOutputCaptureTests.java similarity index 97% rename from spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/testing/utilities/outputcapture/OutputCaptureTests.java rename to spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/testing/utilities/outputcapture/MyOutputCaptureTests.java index b96a3b3184..589eef16a6 100644 --- a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/testing/utilities/outputcapture/OutputCaptureTests.java +++ b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/testing/utilities/outputcapture/MyOutputCaptureTests.java @@ -25,7 +25,7 @@ import org.springframework.boot.test.system.OutputCaptureExtension; import static org.assertj.core.api.Assertions.assertThat; @ExtendWith(OutputCaptureExtension.class) -class OutputCaptureTests { +class MyOutputCaptureTests { @Test void testName(CapturedOutput output) { diff --git a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/testing/utilities/testresttemplate/MySpringBootTestsConfiguration.java b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/testing/utilities/testresttemplate/MySpringBootTestsConfiguration.java index dff84df28e..9cbe6f25a5 100644 --- a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/testing/utilities/testresttemplate/MySpringBootTestsConfiguration.java +++ b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/testing/utilities/testresttemplate/MySpringBootTestsConfiguration.java @@ -28,10 +28,10 @@ import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; -@SpringBootConfiguration +@SpringBootConfiguration(proxyBeanMethods = false) @ImportAutoConfiguration({ ServletWebServerFactoryAutoConfiguration.class, DispatcherServletAutoConfiguration.class, JacksonAutoConfiguration.class, HttpMessageConvertersAutoConfiguration.class }) -class MySpringBootTestsConfiguration { +public class MySpringBootTestsConfiguration { @RestController private static class ExampleController { diff --git a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/gettingstarted/firstapplication/code/Example.java b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/gettingstarted/firstapplication/code/MyApplication.java similarity index 93% rename from spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/gettingstarted/firstapplication/code/Example.java rename to spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/gettingstarted/firstapplication/code/MyApplication.java index 38111e0496..c05e4abf45 100644 --- a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/gettingstarted/firstapplication/code/Example.java +++ b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/gettingstarted/firstapplication/code/MyApplication.java @@ -23,7 +23,7 @@ import org.springframework.web.bind.annotation.RestController; @RestController @EnableAutoConfiguration -public class Example { +public class MyApplication { @RequestMapping("/") String home() { @@ -31,7 +31,7 @@ public class Example { } public static void main(String[] args) { - SpringApplication.run(Example.class, args); + SpringApplication.run(MyApplication.class, args); } } diff --git a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/howto/actuator/maphealthindicatorstometrics/MetricsHealthMicrometerExport.java b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/howto/actuator/maphealthindicatorstometrics/MetricsHealthMicrometerExport.java index 908c948d6c..6b53dcc476 100644 --- a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/howto/actuator/maphealthindicatorstometrics/MetricsHealthMicrometerExport.java +++ b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/howto/actuator/maphealthindicatorstometrics/MetricsHealthMicrometerExport.java @@ -16,37 +16,6 @@ package org.springframework.boot.docs.howto.actuator.maphealthindicatorstometrics; -import io.micrometer.core.instrument.Gauge; -import io.micrometer.core.instrument.MeterRegistry; - -import org.springframework.boot.actuate.health.HealthEndpoint; -import org.springframework.boot.actuate.health.Status; -import org.springframework.context.annotation.Configuration; - public class MetricsHealthMicrometerExport { - @Configuration - public class HealthMetricsConfiguration { - - public HealthMetricsConfiguration(MeterRegistry registry, HealthEndpoint healthEndpoint) { - // This example presumes common tags (such as the app) are applied elsewhere - Gauge.builder("health", healthEndpoint, this::getStatusCode).strongReference(true).register(registry); - } - - private int getStatusCode(HealthEndpoint health) { - Status status = health.health().getStatus(); - if (Status.UP.equals(status)) { - return 3; - } - if (Status.OUT_OF_SERVICE.equals(status)) { - return 2; - } - if (Status.DOWN.equals(status)) { - return 1; - } - return 0; - } - - } - } diff --git a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/howto/actuator/maphealthindicatorstometrics/MyHealthMetricsExportConfiguration.java b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/howto/actuator/maphealthindicatorstometrics/MyHealthMetricsExportConfiguration.java new file mode 100644 index 0000000000..9af5092ee0 --- /dev/null +++ b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/howto/actuator/maphealthindicatorstometrics/MyHealthMetricsExportConfiguration.java @@ -0,0 +1,48 @@ +/* + * Copyright 2012-2021 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.springframework.boot.docs.howto.actuator.maphealthindicatorstometrics; + +import io.micrometer.core.instrument.Gauge; +import io.micrometer.core.instrument.MeterRegistry; + +import org.springframework.boot.actuate.health.HealthEndpoint; +import org.springframework.boot.actuate.health.Status; +import org.springframework.context.annotation.Configuration; + +@Configuration(proxyBeanMethods = false) +public class MyHealthMetricsExportConfiguration { + + public MyHealthMetricsExportConfiguration(MeterRegistry registry, HealthEndpoint healthEndpoint) { + // This example presumes common tags (such as the app) are applied elsewhere + Gauge.builder("health", healthEndpoint, this::getStatusCode).strongReference(true).register(registry); + } + + private int getStatusCode(HealthEndpoint health) { + Status status = health.health().getStatus(); + if (Status.UP.equals(status)) { + return 3; + } + if (Status.OUT_OF_SERVICE.equals(status)) { + return 2; + } + if (Status.DOWN.equals(status)) { + return 1; + } + return 0; + } + +} diff --git a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/howto/dataaccess/R2dbcDatabaseInitializationConfiguration.java b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/howto/dataaccess/R2dbcDatabaseInitializationConfiguration.java index 4c9626a3c2..042dcd1df3 100644 --- a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/howto/dataaccess/R2dbcDatabaseInitializationConfiguration.java +++ b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/howto/dataaccess/R2dbcDatabaseInitializationConfiguration.java @@ -29,7 +29,7 @@ import org.springframework.r2dbc.connection.init.ResourceDatabasePopulator; public class R2dbcDatabaseInitializationConfiguration { @Autowired - void initializeDatabase(ConnectionFactory connectionFactory) { + public void initializeDatabase(ConnectionFactory connectionFactory) { ResourceLoader resourceLoader = new DefaultResourceLoader(); Resource[] scripts = new Resource[] { resourceLoader.getResource("classpath:schema.sql"), resourceLoader.getResource("classpath:data.sql") }; diff --git a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/howto/dataaccess/configureacomponentthatisusedbyjpa/ElasticsearchEntityManagerFactoryDependsOnPostProcessor.java b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/howto/dataaccess/configureacomponentthatisusedbyjpa/ElasticsearchEntityManagerFactoryDependsOnPostProcessor.java index 7d7e943caf..b9bb55de1c 100644 --- a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/howto/dataaccess/configureacomponentthatisusedbyjpa/ElasticsearchEntityManagerFactoryDependsOnPostProcessor.java +++ b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/howto/dataaccess/configureacomponentthatisusedbyjpa/ElasticsearchEntityManagerFactoryDependsOnPostProcessor.java @@ -29,7 +29,7 @@ import org.springframework.stereotype.Component; public class ElasticsearchEntityManagerFactoryDependsOnPostProcessor extends EntityManagerFactoryDependsOnPostProcessor { - ElasticsearchEntityManagerFactoryDependsOnPostProcessor() { + public ElasticsearchEntityManagerFactoryDependsOnPostProcessor() { super("elasticsearchClient"); } diff --git a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/howto/dataaccess/configurecustomdatasource/BasicDataSourceConfiguration.java b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/howto/dataaccess/configurecustomdatasource/builder/MyDataSourceConfiguration.java similarity index 94% rename from spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/howto/dataaccess/configurecustomdatasource/BasicDataSourceConfiguration.java rename to spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/howto/dataaccess/configurecustomdatasource/builder/MyDataSourceConfiguration.java index f875456c90..97a3dfd1da 100644 --- a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/howto/dataaccess/configurecustomdatasource/BasicDataSourceConfiguration.java +++ b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/howto/dataaccess/configurecustomdatasource/builder/MyDataSourceConfiguration.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.docs.howto.dataaccess.configurecustomdatasource; +package org.springframework.boot.docs.howto.dataaccess.configurecustomdatasource.builder; import javax.sql.DataSource; @@ -24,7 +24,7 @@ import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; @Configuration(proxyBeanMethods = false) -public class BasicDataSourceConfiguration { +public class MyDataSourceConfiguration { @Bean @ConfigurationProperties("app.datasource") diff --git a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/howto/dataaccess/configurecustomdatasource/ConfigurableDataSourceConfiguration.java b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/howto/dataaccess/configurecustomdatasource/configurable/MyDataSourceConfiguration.java similarity index 95% rename from spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/howto/dataaccess/configurecustomdatasource/ConfigurableDataSourceConfiguration.java rename to spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/howto/dataaccess/configurecustomdatasource/configurable/MyDataSourceConfiguration.java index 9c0b163ba1..17b8a8079c 100644 --- a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/howto/dataaccess/configurecustomdatasource/ConfigurableDataSourceConfiguration.java +++ b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/howto/dataaccess/configurecustomdatasource/configurable/MyDataSourceConfiguration.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.docs.howto.dataaccess.configurecustomdatasource; +package org.springframework.boot.docs.howto.dataaccess.configurecustomdatasource.configurable; import com.zaxxer.hikari.HikariDataSource; @@ -25,7 +25,7 @@ import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Primary; @Configuration(proxyBeanMethods = false) -public class ConfigurableDataSourceConfiguration { +public class MyDataSourceConfiguration { @Bean @Primary diff --git a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/howto/dataaccess/configurecustomdatasource/FancyDataSourceConfiguration.java b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/howto/dataaccess/configurecustomdatasource/custom/MyDataSourceConfiguration.java similarity index 78% rename from spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/howto/dataaccess/configurecustomdatasource/FancyDataSourceConfiguration.java rename to spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/howto/dataaccess/configurecustomdatasource/custom/MyDataSourceConfiguration.java index b871a92a05..72104f971a 100644 --- a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/howto/dataaccess/configurecustomdatasource/FancyDataSourceConfiguration.java +++ b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/howto/dataaccess/configurecustomdatasource/custom/MyDataSourceConfiguration.java @@ -14,17 +14,19 @@ * limitations under the License. */ -package org.springframework.boot.docs.howto.dataaccess.configurecustomdatasource; +package org.springframework.boot.docs.howto.dataaccess.configurecustomdatasource.custom; import org.springframework.boot.context.properties.ConfigurationProperties; import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; -public class FancyDataSourceConfiguration { +@Configuration(proxyBeanMethods = false) +public class MyDataSourceConfiguration { @Bean @ConfigurationProperties(prefix = "app.datasource") - public FancyDataSource dataSource() { - return new FancyDataSource(); + public SomeDataSource dataSource() { + return new SomeDataSource(); } } diff --git a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/howto/dataaccess/configurecustomdatasource/FancyDataSource.java b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/howto/dataaccess/configurecustomdatasource/custom/SomeDataSource.java similarity index 92% rename from spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/howto/dataaccess/configurecustomdatasource/FancyDataSource.java rename to spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/howto/dataaccess/configurecustomdatasource/custom/SomeDataSource.java index ad3beeac47..13324df263 100644 --- a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/howto/dataaccess/configurecustomdatasource/FancyDataSource.java +++ b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/howto/dataaccess/configurecustomdatasource/custom/SomeDataSource.java @@ -14,8 +14,8 @@ * limitations under the License. */ -package org.springframework.boot.docs.howto.dataaccess.configurecustomdatasource; +package org.springframework.boot.docs.howto.dataaccess.configurecustomdatasource.custom; -public class FancyDataSource { +public class SomeDataSource { } diff --git a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/howto/dataaccess/configurecustomdatasource/SimpleDataSourceConfiguration.java b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/howto/dataaccess/configurecustomdatasource/simple/MyDataSourceConfiguration.java similarity index 94% rename from spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/howto/dataaccess/configurecustomdatasource/SimpleDataSourceConfiguration.java rename to spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/howto/dataaccess/configurecustomdatasource/simple/MyDataSourceConfiguration.java index ef58e12312..1c98791a81 100644 --- a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/howto/dataaccess/configurecustomdatasource/SimpleDataSourceConfiguration.java +++ b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/howto/dataaccess/configurecustomdatasource/simple/MyDataSourceConfiguration.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.docs.howto.dataaccess.configurecustomdatasource; +package org.springframework.boot.docs.howto.dataaccess.configurecustomdatasource.simple; import com.zaxxer.hikari.HikariDataSource; @@ -24,7 +24,7 @@ import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; @Configuration(proxyBeanMethods = false) -public class SimpleDataSourceConfiguration { +public class MyDataSourceConfiguration { @Bean @ConfigurationProperties("app.datasource") diff --git a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/howto/dataaccess/configurehibernatesecondlevelcaching/HibernateSecondLevelCacheConfiguration.java b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/howto/dataaccess/configurehibernatesecondlevelcaching/MyHibernateSecondLevelCacheConfiguration.java similarity index 95% rename from spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/howto/dataaccess/configurehibernatesecondlevelcaching/HibernateSecondLevelCacheConfiguration.java rename to spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/howto/dataaccess/configurehibernatesecondlevelcaching/MyHibernateSecondLevelCacheConfiguration.java index e17c811963..476d742c49 100644 --- a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/howto/dataaccess/configurehibernatesecondlevelcaching/HibernateSecondLevelCacheConfiguration.java +++ b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/howto/dataaccess/configurehibernatesecondlevelcaching/MyHibernateSecondLevelCacheConfiguration.java @@ -24,7 +24,7 @@ import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; @Configuration(proxyBeanMethods = false) -public class HibernateSecondLevelCacheConfiguration { +public class MyHibernateSecondLevelCacheConfiguration { @Bean public HibernatePropertiesCustomizer hibernateSecondLevelCacheCustomizer(JCacheCacheManager cacheManager) { diff --git a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/howto/dataaccess/configuretwodatasources/CompleteDataSourcesConfiguration.java b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/howto/dataaccess/configuretwodatasources/MyCompleteDataSourcesConfiguration.java similarity index 76% rename from spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/howto/dataaccess/configuretwodatasources/CompleteDataSourcesConfiguration.java rename to spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/howto/dataaccess/configuretwodatasources/MyCompleteDataSourcesConfiguration.java index 429ed1d445..5cd576bf12 100644 --- a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/howto/dataaccess/configuretwodatasources/CompleteDataSourcesConfiguration.java +++ b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/howto/dataaccess/configuretwodatasources/MyCompleteDataSourcesConfiguration.java @@ -25,8 +25,8 @@ import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Primary; -@Configuration -public class CompleteDataSourcesConfiguration { +@Configuration(proxyBeanMethods = false) +public class MyCompleteDataSourcesConfiguration { @Bean @Primary @@ -38,8 +38,8 @@ public class CompleteDataSourcesConfiguration { @Bean @Primary @ConfigurationProperties("app.datasource.first.configuration") - public HikariDataSource firstDataSource() { - return firstDataSourceProperties().initializeDataSourceBuilder().type(HikariDataSource.class).build(); + public HikariDataSource firstDataSource(DataSourceProperties firstDataSourceProperties) { + return firstDataSourceProperties.initializeDataSourceBuilder().type(HikariDataSource.class).build(); } @Bean @@ -50,8 +50,8 @@ public class CompleteDataSourcesConfiguration { @Bean @ConfigurationProperties("app.datasource.second.configuration") - public BasicDataSource secondDataSource() { - return secondDataSourceProperties().initializeDataSourceBuilder().type(BasicDataSource.class).build(); + public BasicDataSource secondDataSource(DataSourceProperties secondDataSourceProperties) { + return secondDataSourceProperties.initializeDataSourceBuilder().type(BasicDataSource.class).build(); } } diff --git a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/howto/dataaccess/configuretwodatasources/SimpleDataSourcesConfiguration.java b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/howto/dataaccess/configuretwodatasources/MyDataSourcesConfiguration.java similarity index 85% rename from spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/howto/dataaccess/configuretwodatasources/SimpleDataSourcesConfiguration.java rename to spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/howto/dataaccess/configuretwodatasources/MyDataSourcesConfiguration.java index d559c1664a..c88ba5a727 100644 --- a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/howto/dataaccess/configuretwodatasources/SimpleDataSourcesConfiguration.java +++ b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/howto/dataaccess/configuretwodatasources/MyDataSourcesConfiguration.java @@ -26,8 +26,8 @@ import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Primary; -@Configuration -public class SimpleDataSourcesConfiguration { +@Configuration(proxyBeanMethods = false) +public class MyDataSourcesConfiguration { @Bean @Primary @@ -39,8 +39,8 @@ public class SimpleDataSourcesConfiguration { @Bean @Primary @ConfigurationProperties("app.datasource.first.configuration") - public HikariDataSource firstDataSource() { - return firstDataSourceProperties().initializeDataSourceBuilder().type(HikariDataSource.class).build(); + public HikariDataSource firstDataSource(DataSourceProperties firstDataSourceProperties) { + return firstDataSourceProperties.initializeDataSourceBuilder().type(HikariDataSource.class).build(); } @Bean diff --git a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/howto/dataaccess/separateentitydefinitionsfromspringconfiguration/Application.java b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/howto/dataaccess/separateentitydefinitionsfromspringconfiguration/MyApplication.java similarity index 97% rename from spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/howto/dataaccess/separateentitydefinitionsfromspringconfiguration/Application.java rename to spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/howto/dataaccess/separateentitydefinitionsfromspringconfiguration/MyApplication.java index 91eb02e6a4..8627bafc13 100644 --- a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/howto/dataaccess/separateentitydefinitionsfromspringconfiguration/Application.java +++ b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/howto/dataaccess/separateentitydefinitionsfromspringconfiguration/MyApplication.java @@ -23,7 +23,7 @@ import org.springframework.context.annotation.Configuration; @Configuration(proxyBeanMethods = false) @EnableAutoConfiguration @EntityScan(basePackageClasses = City.class) -public class Application { +public class MyApplication { // ... diff --git a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/howto/dataaccess/usemultipleentitymanagers/CustomEntityManagerFactoryConfiguration.java b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/howto/dataaccess/usemultipleentitymanagers/MyEntityManagerFactoryConfiguration.java similarity index 97% rename from spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/howto/dataaccess/usemultipleentitymanagers/CustomEntityManagerFactoryConfiguration.java rename to spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/howto/dataaccess/usemultipleentitymanagers/MyEntityManagerFactoryConfiguration.java index 6f917c0af2..11f898027b 100644 --- a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/howto/dataaccess/usemultipleentitymanagers/CustomEntityManagerFactoryConfiguration.java +++ b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/howto/dataaccess/usemultipleentitymanagers/MyEntityManagerFactoryConfiguration.java @@ -28,7 +28,7 @@ import org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean; import org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter; @Configuration(proxyBeanMethods = false) -public class CustomEntityManagerFactoryConfiguration { +public class MyEntityManagerFactoryConfiguration { @Bean @ConfigurationProperties("app.jpa.first") diff --git a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/howto/testingwithspringsecurity/MySecurityTests.java b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/howto/testingwithspringsecurity/MySecurityTests.java index 0a5227ccdf..d322bb7369 100644 --- a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/howto/testingwithspringsecurity/MySecurityTests.java +++ b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/howto/testingwithspringsecurity/MySecurityTests.java @@ -26,7 +26,7 @@ import org.springframework.test.web.servlet.MockMvc; import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; @WebMvcTest(UserController.class) -public class MySecurityTests { +class MySecurityTests { @Autowired private MockMvc mvc; diff --git a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/howto/webserver/enablemultipleconnectorsintomcat/TomcatMultipleConnectorsConfiguration.java b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/howto/webserver/enablemultipleconnectorsintomcat/MyTomcatConfiguration.java similarity index 97% rename from spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/howto/webserver/enablemultipleconnectorsintomcat/TomcatMultipleConnectorsConfiguration.java rename to spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/howto/webserver/enablemultipleconnectorsintomcat/MyTomcatConfiguration.java index 9b287186ce..218a9cc9d6 100644 --- a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/howto/webserver/enablemultipleconnectorsintomcat/TomcatMultipleConnectorsConfiguration.java +++ b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/howto/webserver/enablemultipleconnectorsintomcat/MyTomcatConfiguration.java @@ -29,7 +29,7 @@ import org.springframework.context.annotation.Configuration; import org.springframework.util.ResourceUtils; @Configuration(proxyBeanMethods = false) -public class TomcatMultipleConnectorsConfiguration { +public class MyTomcatConfiguration { @Bean public WebServerFactoryCustomizer sslConnectorCustomizer() { diff --git a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/howto/webserver/enablemultiplelistenersinundertow/UndertowMultipleListenersConfiguration.java b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/howto/webserver/enablemultiplelistenersinundertow/MyUndertowConfiguration.java similarity index 96% rename from spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/howto/webserver/enablemultiplelistenersinundertow/UndertowMultipleListenersConfiguration.java rename to spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/howto/webserver/enablemultiplelistenersinundertow/MyUndertowConfiguration.java index c0da0b8fee..35ab674a03 100644 --- a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/howto/webserver/enablemultiplelistenersinundertow/UndertowMultipleListenersConfiguration.java +++ b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/howto/webserver/enablemultiplelistenersinundertow/MyUndertowConfiguration.java @@ -24,7 +24,7 @@ import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; @Configuration(proxyBeanMethods = false) -public class UndertowMultipleListenersConfiguration { +public class MyUndertowConfiguration { @Bean public WebServerFactoryCustomizer undertowListenerCustomizer() { diff --git a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/howto/webserver/usetomcatlegacycookieprocessor/LegacyCookieProcessorConfiguration.java b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/howto/webserver/usetomcatlegacycookieprocessor/MyLegacyCookieProcessorConfiguration.java similarity index 96% rename from spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/howto/webserver/usetomcatlegacycookieprocessor/LegacyCookieProcessorConfiguration.java rename to spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/howto/webserver/usetomcatlegacycookieprocessor/MyLegacyCookieProcessorConfiguration.java index fd8e9f8a9f..fb1702f99d 100644 --- a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/howto/webserver/usetomcatlegacycookieprocessor/LegacyCookieProcessorConfiguration.java +++ b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/howto/webserver/usetomcatlegacycookieprocessor/MyLegacyCookieProcessorConfiguration.java @@ -24,7 +24,7 @@ import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; @Configuration(proxyBeanMethods = false) -public class LegacyCookieProcessorConfiguration { +public class MyLegacyCookieProcessorConfiguration { @Bean public WebServerFactoryCustomizer cookieProcessorCustomizer() { diff --git a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/using/springbeansanddependencyinjection/multipleconstructors/DatabaseAccountService.java b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/using/springbeansanddependencyinjection/multipleconstructors/MyAccountService.java similarity index 85% rename from spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/using/springbeansanddependencyinjection/multipleconstructors/DatabaseAccountService.java rename to spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/using/springbeansanddependencyinjection/multipleconstructors/MyAccountService.java index fe314ec061..7425c7de44 100644 --- a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/using/springbeansanddependencyinjection/multipleconstructors/DatabaseAccountService.java +++ b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/using/springbeansanddependencyinjection/multipleconstructors/MyAccountService.java @@ -22,7 +22,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @Service -public class DatabaseAccountService implements AccountService { +public class MyAccountService implements AccountService { @SuppressWarnings("unused") private final RiskAssessor riskAssessor; @@ -31,12 +31,12 @@ public class DatabaseAccountService implements AccountService { private final PrintStream out; @Autowired - public DatabaseAccountService(RiskAssessor riskAssessor) { + public MyAccountService(RiskAssessor riskAssessor) { this.riskAssessor = riskAssessor; this.out = System.out; } - public DatabaseAccountService(RiskAssessor riskAssessor, PrintStream out) { + public MyAccountService(RiskAssessor riskAssessor, PrintStream out) { this.riskAssessor = riskAssessor; this.out = out; } diff --git a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/using/springbeansanddependencyinjection/singleconstructor/DatabaseAccountService.java b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/using/springbeansanddependencyinjection/singleconstructor/MyAccountService.java similarity index 87% rename from spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/using/springbeansanddependencyinjection/singleconstructor/DatabaseAccountService.java rename to spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/using/springbeansanddependencyinjection/singleconstructor/MyAccountService.java index 48b0ecd3a7..f885f9c750 100644 --- a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/using/springbeansanddependencyinjection/singleconstructor/DatabaseAccountService.java +++ b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/using/springbeansanddependencyinjection/singleconstructor/MyAccountService.java @@ -19,12 +19,12 @@ package org.springframework.boot.docs.using.springbeansanddependencyinjection.si import org.springframework.stereotype.Service; @Service -public class DatabaseAccountService implements AccountService { +public class MyAccountService implements AccountService { @SuppressWarnings("unused") private final RiskAssessor riskAssessor; - public DatabaseAccountService(RiskAssessor riskAssessor) { + public MyAccountService(RiskAssessor riskAssessor) { this.riskAssessor = riskAssessor; } diff --git a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/using/usingthespringbootapplicationannotation/individualannotations/MyConfig.java b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/using/usingthespringbootapplicationannotation/individualannotations/AnotherConfiguration.java similarity index 95% rename from spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/using/usingthespringbootapplicationannotation/individualannotations/MyConfig.java rename to spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/using/usingthespringbootapplicationannotation/individualannotations/AnotherConfiguration.java index 3052ea8da3..c8137d4348 100644 --- a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/using/usingthespringbootapplicationannotation/individualannotations/MyConfig.java +++ b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/using/usingthespringbootapplicationannotation/individualannotations/AnotherConfiguration.java @@ -16,6 +16,6 @@ package org.springframework.boot.docs.using.usingthespringbootapplicationannotation.individualannotations; -public class MyConfig { +public class AnotherConfiguration { } diff --git a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/using/usingthespringbootapplicationannotation/individualannotations/MyApplication.java b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/using/usingthespringbootapplicationannotation/individualannotations/MyApplication.java index ba27831866..5a8ec3c85b 100644 --- a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/using/usingthespringbootapplicationannotation/individualannotations/MyApplication.java +++ b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/using/usingthespringbootapplicationannotation/individualannotations/MyApplication.java @@ -23,7 +23,7 @@ import org.springframework.context.annotation.Import; @Configuration(proxyBeanMethods = false) @EnableAutoConfiguration -@Import({ MyConfig.class, MyAnotherConfig.class }) +@Import({ SomeConfiguration.class, AnotherConfiguration.class }) public class MyApplication { public static void main(String[] args) { diff --git a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/using/usingthespringbootapplicationannotation/individualannotations/MyAnotherConfig.java b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/using/usingthespringbootapplicationannotation/individualannotations/SomeConfiguration.java similarity index 95% rename from spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/using/usingthespringbootapplicationannotation/individualannotations/MyAnotherConfig.java rename to spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/using/usingthespringbootapplicationannotation/individualannotations/SomeConfiguration.java index 05502c9d28..c442681569 100644 --- a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/using/usingthespringbootapplicationannotation/individualannotations/MyAnotherConfig.java +++ b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/using/usingthespringbootapplicationannotation/individualannotations/SomeConfiguration.java @@ -16,6 +16,6 @@ package org.springframework.boot.docs.using.usingthespringbootapplicationannotation.individualannotations; -public class MyAnotherConfig { +public class SomeConfiguration { } diff --git a/spring-boot-project/spring-boot-docs/src/test/java/org/springframework/boot/docs/features/developingautoconfiguration/testing/UserServiceAutoConfigurationTestsTests.java b/spring-boot-project/spring-boot-docs/src/test/java/org/springframework/boot/docs/features/developingautoconfiguration/testing/MyServiceAutoConfigurationTestsTests.java similarity index 83% rename from spring-boot-project/spring-boot-docs/src/test/java/org/springframework/boot/docs/features/developingautoconfiguration/testing/UserServiceAutoConfigurationTestsTests.java rename to spring-boot-project/spring-boot-docs/src/test/java/org/springframework/boot/docs/features/developingautoconfiguration/testing/MyServiceAutoConfigurationTestsTests.java index 476b71cc60..b48f2d147a 100644 --- a/spring-boot-project/spring-boot-docs/src/test/java/org/springframework/boot/docs/features/developingautoconfiguration/testing/UserServiceAutoConfigurationTestsTests.java +++ b/spring-boot-project/spring-boot-docs/src/test/java/org/springframework/boot/docs/features/developingautoconfiguration/testing/MyServiceAutoConfigurationTestsTests.java @@ -17,10 +17,10 @@ package org.springframework.boot.docs.features.developingautoconfiguration.testing; /** - * Tests for {@link UserServiceAutoConfigurationTests}. + * Tests for {@link MyServiceAutoConfigurationTests}. * * @author Stephane Nicoll */ -class UserServiceAutoConfigurationTestsTests extends UserServiceAutoConfigurationTests { +class MyServiceAutoConfigurationTestsTests extends MyServiceAutoConfigurationTests { } diff --git a/spring-boot-project/spring-boot-docs/src/test/java/org/springframework/boot/docs/features/externalconfig/typesafeconfigurationproperties/conversion/durations/constructorbinding/AppSystemPropertiesTests.java b/spring-boot-project/spring-boot-docs/src/test/java/org/springframework/boot/docs/features/externalconfig/typesafeconfigurationproperties/conversion/durations/constructorbinding/MyPropertiesTests.java similarity index 78% rename from spring-boot-project/spring-boot-docs/src/test/java/org/springframework/boot/docs/features/externalconfig/typesafeconfigurationproperties/conversion/durations/constructorbinding/AppSystemPropertiesTests.java rename to spring-boot-project/spring-boot-docs/src/test/java/org/springframework/boot/docs/features/externalconfig/typesafeconfigurationproperties/conversion/durations/constructorbinding/MyPropertiesTests.java index ac4a8e6f75..6e3d9c6a3c 100644 --- a/spring-boot-project/spring-boot-docs/src/test/java/org/springframework/boot/docs/features/externalconfig/typesafeconfigurationproperties/conversion/durations/constructorbinding/AppSystemPropertiesTests.java +++ b/spring-boot-project/spring-boot-docs/src/test/java/org/springframework/boot/docs/features/externalconfig/typesafeconfigurationproperties/conversion/durations/constructorbinding/MyPropertiesTests.java @@ -29,18 +29,18 @@ import org.springframework.context.annotation.Configuration; import static org.assertj.core.api.Assertions.assertThat; /** - * Tests for {@link AppSystemProperties}. + * Tests for {@link MyProperties}. * * @author Stephane Nicoll */ -class AppSystemPropertiesTests { +class MyPropertiesTests { private final ApplicationContextRunner contextRunner = new ApplicationContextRunner() .withUserConfiguration(Config.class); @Test void bindWithDefaultUnit() { - this.contextRunner.withPropertyValues("app.system.session-timeout=40", "app.system.read-timeout=5000") + this.contextRunner.withPropertyValues("my.session-timeout=40", "my.read-timeout=5000") .run(assertBinding((properties) -> { assertThat(properties.getSessionTimeout()).hasSeconds(40); assertThat(properties.getReadTimeout()).hasMillis(5000); @@ -49,7 +49,7 @@ class AppSystemPropertiesTests { @Test void bindWithExplicitUnit() { - this.contextRunner.withPropertyValues("app.system.session-timeout=1h", "app.system.read-timeout=5s") + this.contextRunner.withPropertyValues("my.session-timeout=1h", "my.read-timeout=5s") .run(assertBinding((properties) -> { assertThat(properties.getSessionTimeout()).hasMinutes(60); assertThat(properties.getReadTimeout()).hasMillis(5000); @@ -58,22 +58,22 @@ class AppSystemPropertiesTests { @Test void bindWithIso8601Format() { - this.contextRunner.withPropertyValues("app.system.session-timeout=PT15S", "app.system.read-timeout=PT0.5S") + this.contextRunner.withPropertyValues("my.session-timeout=PT15S", "my.read-timeout=PT0.5S") .run(assertBinding((properties) -> { assertThat(properties.getSessionTimeout()).hasSeconds(15); assertThat(properties.getReadTimeout()).hasMillis(500); })); } - private ContextConsumer assertBinding(Consumer properties) { + private ContextConsumer assertBinding(Consumer properties) { return (context) -> { - assertThat(context).hasSingleBean(AppSystemProperties.class); - properties.accept(context.getBean(AppSystemProperties.class)); + assertThat(context).hasSingleBean(MyProperties.class); + properties.accept(context.getBean(MyProperties.class)); }; } @Configuration(proxyBeanMethods = false) - @EnableConfigurationProperties(AppSystemProperties.class) + @EnableConfigurationProperties(MyProperties.class) static class Config { } diff --git a/spring-boot-project/spring-boot-docs/src/test/java/org/springframework/boot/docs/features/externalconfig/typesafeconfigurationproperties/conversion/durations/javabeanbinding/AppSystemPropertiesTests.java b/spring-boot-project/spring-boot-docs/src/test/java/org/springframework/boot/docs/features/externalconfig/typesafeconfigurationproperties/conversion/durations/javabeanbinding/MyPropertiesTests.java similarity index 78% rename from spring-boot-project/spring-boot-docs/src/test/java/org/springframework/boot/docs/features/externalconfig/typesafeconfigurationproperties/conversion/durations/javabeanbinding/AppSystemPropertiesTests.java rename to spring-boot-project/spring-boot-docs/src/test/java/org/springframework/boot/docs/features/externalconfig/typesafeconfigurationproperties/conversion/durations/javabeanbinding/MyPropertiesTests.java index fc902f9d92..d5652489ff 100644 --- a/spring-boot-project/spring-boot-docs/src/test/java/org/springframework/boot/docs/features/externalconfig/typesafeconfigurationproperties/conversion/durations/javabeanbinding/AppSystemPropertiesTests.java +++ b/spring-boot-project/spring-boot-docs/src/test/java/org/springframework/boot/docs/features/externalconfig/typesafeconfigurationproperties/conversion/durations/javabeanbinding/MyPropertiesTests.java @@ -29,18 +29,18 @@ import org.springframework.context.annotation.Configuration; import static org.assertj.core.api.Assertions.assertThat; /** - * Tests for {@link AppSystemProperties}. + * Tests for {@link MyProperties}. * * @author Stephane Nicoll */ -class AppSystemPropertiesTests { +class MyPropertiesTests { private final ApplicationContextRunner contextRunner = new ApplicationContextRunner() .withUserConfiguration(Config.class); @Test void bindWithDefaultUnit() { - this.contextRunner.withPropertyValues("app.system.session-timeout=40", "app.system.read-timeout=5000") + this.contextRunner.withPropertyValues("my.session-timeout=40", "my.read-timeout=5000") .run(assertBinding((properties) -> { assertThat(properties.getSessionTimeout()).hasSeconds(40); assertThat(properties.getReadTimeout()).hasMillis(5000); @@ -49,7 +49,7 @@ class AppSystemPropertiesTests { @Test void bindWithExplicitUnit() { - this.contextRunner.withPropertyValues("app.system.session-timeout=1h", "app.system.read-timeout=5s") + this.contextRunner.withPropertyValues("my.session-timeout=1h", "my.read-timeout=5s") .run(assertBinding((properties) -> { assertThat(properties.getSessionTimeout()).hasMinutes(60); assertThat(properties.getReadTimeout()).hasMillis(5000); @@ -58,22 +58,22 @@ class AppSystemPropertiesTests { @Test void bindWithIso8601Format() { - this.contextRunner.withPropertyValues("app.system.session-timeout=PT15S", "app.system.read-timeout=PT0.5S") + this.contextRunner.withPropertyValues("my.session-timeout=PT15S", "my.read-timeout=PT0.5S") .run(assertBinding((properties) -> { assertThat(properties.getSessionTimeout()).hasSeconds(15); assertThat(properties.getReadTimeout()).hasMillis(500); })); } - private ContextConsumer assertBinding(Consumer properties) { + private ContextConsumer assertBinding(Consumer properties) { return (context) -> { - assertThat(context).hasSingleBean(AppSystemProperties.class); - properties.accept(context.getBean(AppSystemProperties.class)); + assertThat(context).hasSingleBean(MyProperties.class); + properties.accept(context.getBean(MyProperties.class)); }; } @Configuration(proxyBeanMethods = false) - @EnableConfigurationProperties(AppSystemProperties.class) + @EnableConfigurationProperties(MyProperties.class) static class Config { } diff --git a/spring-boot-project/spring-boot-docs/src/test/java/org/springframework/boot/docs/features/springapplication/fluentbuilderapi/SpringApplicationBuilderExampleTests.java b/spring-boot-project/spring-boot-docs/src/test/java/org/springframework/boot/docs/features/springapplication/fluentbuilderapi/MyApplicationTests.java similarity index 88% rename from spring-boot-project/spring-boot-docs/src/test/java/org/springframework/boot/docs/features/springapplication/fluentbuilderapi/SpringApplicationBuilderExampleTests.java rename to spring-boot-project/spring-boot-docs/src/test/java/org/springframework/boot/docs/features/springapplication/fluentbuilderapi/MyApplicationTests.java index 2a9cc9c27c..d78dda2622 100644 --- a/spring-boot-project/spring-boot-docs/src/test/java/org/springframework/boot/docs/features/springapplication/fluentbuilderapi/SpringApplicationBuilderExampleTests.java +++ b/spring-boot-project/spring-boot-docs/src/test/java/org/springframework/boot/docs/features/springapplication/fluentbuilderapi/MyApplicationTests.java @@ -25,18 +25,18 @@ import org.springframework.boot.test.system.OutputCaptureExtension; import static org.assertj.core.api.Assertions.assertThat; /** - * Tests for {@link SpringApplicationBuilderExample}. + * Tests for {@link MyApplication}. * * @author Andy Wilkinson */ @ExtendWith(OutputCaptureExtension.class) -class SpringApplicationBuilderExampleTests { +class MyApplicationTests { @Test void contextHierarchyWithDisabledBanner(CapturedOutput output) { System.setProperty("spring.main.web-application-type", "none"); try { - new SpringApplicationBuilderExample().hierarchyWithDisabledBanner(new String[0]); + new MyApplication().hierarchyWithDisabledBanner(new String[0]); assertThat(output).doesNotContain(":: Spring Boot ::"); } finally { diff --git a/spring-boot-project/spring-boot-docs/src/test/java/org/springframework/boot/docs/features/testing/springbootapplications/jmx/SampleJmxTestsTests.java b/spring-boot-project/spring-boot-docs/src/test/java/org/springframework/boot/docs/features/testing/springbootapplications/jmx/MyJmxTestsTests.java similarity index 93% rename from spring-boot-project/spring-boot-docs/src/test/java/org/springframework/boot/docs/features/testing/springbootapplications/jmx/SampleJmxTestsTests.java rename to spring-boot-project/spring-boot-docs/src/test/java/org/springframework/boot/docs/features/testing/springbootapplications/jmx/MyJmxTestsTests.java index 83570c9c14..fb9e56d217 100644 --- a/spring-boot-project/spring-boot-docs/src/test/java/org/springframework/boot/docs/features/testing/springbootapplications/jmx/SampleJmxTestsTests.java +++ b/spring-boot-project/spring-boot-docs/src/test/java/org/springframework/boot/docs/features/testing/springbootapplications/jmx/MyJmxTestsTests.java @@ -21,6 +21,6 @@ package org.springframework.boot.docs.features.testing.springbootapplications.jm * * @author Stephane Nicoll */ -class SampleJmxTestsTests extends SampleJmxTests { +class MyJmxTestsTests extends MyJmxTests { } diff --git a/spring-boot-project/spring-boot-docs/src/test/java/org/springframework/boot/docs/features/testing/utilities/outputcapture/OutputCaptureTestsTests.java b/spring-boot-project/spring-boot-docs/src/test/java/org/springframework/boot/docs/features/testing/utilities/outputcapture/MyOutputCaptureTestsTests.java similarity index 87% rename from spring-boot-project/spring-boot-docs/src/test/java/org/springframework/boot/docs/features/testing/utilities/outputcapture/OutputCaptureTestsTests.java rename to spring-boot-project/spring-boot-docs/src/test/java/org/springframework/boot/docs/features/testing/utilities/outputcapture/MyOutputCaptureTestsTests.java index 7fb0f26319..d7f587b283 100644 --- a/spring-boot-project/spring-boot-docs/src/test/java/org/springframework/boot/docs/features/testing/utilities/outputcapture/OutputCaptureTestsTests.java +++ b/spring-boot-project/spring-boot-docs/src/test/java/org/springframework/boot/docs/features/testing/utilities/outputcapture/MyOutputCaptureTestsTests.java @@ -17,10 +17,10 @@ package org.springframework.boot.docs.features.testing.utilities.outputcapture; /** - * Tests for {@link OutputCaptureTests}. + * Tests for {@link MyOutputCaptureTests}. * * @author Stephane Nicoll */ -class OutputCaptureTestsTests extends OutputCaptureTests { +class MyOutputCaptureTestsTests extends MyOutputCaptureTests { } diff --git a/spring-boot-project/spring-boot-docs/src/test/java/org/springframework/boot/docs/howto/actuator/maphealthindicatorstometrics/MetricsHealthMicrometerExportTests.java b/spring-boot-project/spring-boot-docs/src/test/java/org/springframework/boot/docs/howto/actuator/maphealthindicatorstometrics/MetricsHealthMicrometerExportTests.java index 3ebe9c97b0..df93867f10 100644 --- a/spring-boot-project/spring-boot-docs/src/test/java/org/springframework/boot/docs/howto/actuator/maphealthindicatorstometrics/MetricsHealthMicrometerExportTests.java +++ b/spring-boot-project/spring-boot-docs/src/test/java/org/springframework/boot/docs/howto/actuator/maphealthindicatorstometrics/MetricsHealthMicrometerExportTests.java @@ -53,7 +53,7 @@ class MetricsHealthMicrometerExportTests { } @Configuration(proxyBeanMethods = false) - @Import(MetricsHealthMicrometerExport.HealthMetricsConfiguration.class) + @Import(MyHealthMetricsExportConfiguration.class) @ImportAutoConfiguration(classes = { HealthContributorAutoConfiguration.class, MetricsAutoConfiguration.class, HealthEndpointAutoConfiguration.class }) static class Config { diff --git a/spring-boot-project/spring-boot-docs/src/test/java/org/springframework/boot/docs/howto/dataaccess/configurecustomdatasource/BasicDataSourceConfigurationTests.java b/spring-boot-project/spring-boot-docs/src/test/java/org/springframework/boot/docs/howto/dataaccess/configurecustomdatasource/MyDataSourceConfigurationTests.java similarity index 87% rename from spring-boot-project/spring-boot-docs/src/test/java/org/springframework/boot/docs/howto/dataaccess/configurecustomdatasource/BasicDataSourceConfigurationTests.java rename to spring-boot-project/spring-boot-docs/src/test/java/org/springframework/boot/docs/howto/dataaccess/configurecustomdatasource/MyDataSourceConfigurationTests.java index 03428d4f81..d88554d67c 100644 --- a/spring-boot-project/spring-boot-docs/src/test/java/org/springframework/boot/docs/howto/dataaccess/configurecustomdatasource/BasicDataSourceConfigurationTests.java +++ b/spring-boot-project/spring-boot-docs/src/test/java/org/springframework/boot/docs/howto/dataaccess/configurecustomdatasource/MyDataSourceConfigurationTests.java @@ -24,6 +24,7 @@ import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.docs.howto.dataaccess.configurecustomdatasource.builder.MyDataSourceConfiguration; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.context.ApplicationContext; import org.springframework.context.annotation.Import; @@ -32,14 +33,14 @@ import org.springframework.test.context.junit.jupiter.SpringExtension; import static org.assertj.core.api.Assertions.assertThat; /** - * Test for {@link BasicDataSourceConfiguration}. + * Test for {@link MyDataSourceConfiguration}. * * @author Stephane Nicoll */ @ExtendWith(SpringExtension.class) @SpringBootTest(properties = "app.datasource.jdbcUrl=jdbc:h2:mem:basic;DB_CLOSE_DELAY=-1") -@Import(BasicDataSourceConfiguration.class) -class BasicDataSourceConfigurationTests { +@Import(MyDataSourceConfiguration.class) +class MyDataSourceConfigurationTests { @Autowired private ApplicationContext context; diff --git a/spring-boot-project/spring-boot-docs/src/test/java/org/springframework/boot/docs/howto/dataaccess/configurecustomdatasource/ConfigurableDataSourceConfigurationTests.java b/spring-boot-project/spring-boot-docs/src/test/java/org/springframework/boot/docs/howto/dataaccess/configurecustomdatasource/configurable/MyDataSourceConfigurationTests.java similarity index 91% rename from spring-boot-project/spring-boot-docs/src/test/java/org/springframework/boot/docs/howto/dataaccess/configurecustomdatasource/ConfigurableDataSourceConfigurationTests.java rename to spring-boot-project/spring-boot-docs/src/test/java/org/springframework/boot/docs/howto/dataaccess/configurecustomdatasource/configurable/MyDataSourceConfigurationTests.java index e1d10c637f..4a9f09c21c 100644 --- a/spring-boot-project/spring-boot-docs/src/test/java/org/springframework/boot/docs/howto/dataaccess/configurecustomdatasource/ConfigurableDataSourceConfigurationTests.java +++ b/spring-boot-project/spring-boot-docs/src/test/java/org/springframework/boot/docs/howto/dataaccess/configurecustomdatasource/configurable/MyDataSourceConfigurationTests.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.docs.howto.dataaccess.configurecustomdatasource; +package org.springframework.boot.docs.howto.dataaccess.configurecustomdatasource.configurable; import java.sql.SQLException; @@ -33,15 +33,15 @@ import org.springframework.test.context.junit.jupiter.SpringExtension; import static org.assertj.core.api.Assertions.assertThat; /** - * Test for {@link ConfigurableDataSourceConfiguration}. + * Test for {@link MyDataSourceConfiguration}. * * @author Stephane Nicoll */ @ExtendWith(SpringExtension.class) @SpringBootTest(properties = { "app.datasource.url=jdbc:h2:mem:configurable;DB_CLOSE_DELAY=-1", "app.datasource.configuration.maximum-pool-size=42" }) -@Import(ConfigurableDataSourceConfiguration.class) -class ConfigurableDataSourceConfigurationTests { +@Import(MyDataSourceConfiguration.class) +class MyDataSourceConfigurationTests { @Autowired private ApplicationContext context; diff --git a/spring-boot-project/spring-boot-docs/src/test/java/org/springframework/boot/docs/howto/dataaccess/configurecustomdatasource/SimpleDataSourceConfigurationTests.java b/spring-boot-project/spring-boot-docs/src/test/java/org/springframework/boot/docs/howto/dataaccess/configurecustomdatasource/simple/MyDataSourceConfigurationTests.java similarity index 92% rename from spring-boot-project/spring-boot-docs/src/test/java/org/springframework/boot/docs/howto/dataaccess/configurecustomdatasource/SimpleDataSourceConfigurationTests.java rename to spring-boot-project/spring-boot-docs/src/test/java/org/springframework/boot/docs/howto/dataaccess/configurecustomdatasource/simple/MyDataSourceConfigurationTests.java index 829f13850b..bf717145aa 100644 --- a/spring-boot-project/spring-boot-docs/src/test/java/org/springframework/boot/docs/howto/dataaccess/configurecustomdatasource/SimpleDataSourceConfigurationTests.java +++ b/spring-boot-project/spring-boot-docs/src/test/java/org/springframework/boot/docs/howto/dataaccess/configurecustomdatasource/simple/MyDataSourceConfigurationTests.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.docs.howto.dataaccess.configurecustomdatasource; +package org.springframework.boot.docs.howto.dataaccess.configurecustomdatasource.simple; import java.sql.SQLException; @@ -33,15 +33,15 @@ import org.springframework.test.context.junit.jupiter.SpringExtension; import static org.assertj.core.api.Assertions.assertThat; /** - * Test for {@link SimpleDataSourceConfiguration}. + * Test for {@link MyDataSourceConfiguration}. * * @author Stephane Nicoll */ @ExtendWith(SpringExtension.class) @SpringBootTest(properties = { "app.datasource.jdbc-url=jdbc:h2:mem:simple;DB_CLOSE_DELAY=-1", "app.datasource.maximum-pool-size=42" }) -@Import(SimpleDataSourceConfiguration.class) -class SimpleDataSourceConfigurationTests { +@Import(MyDataSourceConfiguration.class) +class MyDataSourceConfigurationTests { @Autowired private ApplicationContext context; diff --git a/spring-boot-project/spring-boot-docs/src/test/java/org/springframework/boot/docs/howto/dataaccess/configuretwodatasources/CompleteDataSourcesConfigurationTests.java b/spring-boot-project/spring-boot-docs/src/test/java/org/springframework/boot/docs/howto/dataaccess/configuretwodatasources/MyCompleteDataSourcesConfigurationTests.java similarity index 92% rename from spring-boot-project/spring-boot-docs/src/test/java/org/springframework/boot/docs/howto/dataaccess/configuretwodatasources/CompleteDataSourcesConfigurationTests.java rename to spring-boot-project/spring-boot-docs/src/test/java/org/springframework/boot/docs/howto/dataaccess/configuretwodatasources/MyCompleteDataSourcesConfigurationTests.java index 41770d3c5b..aa3be89a0c 100644 --- a/spring-boot-project/spring-boot-docs/src/test/java/org/springframework/boot/docs/howto/dataaccess/configuretwodatasources/CompleteDataSourcesConfigurationTests.java +++ b/spring-boot-project/spring-boot-docs/src/test/java/org/springframework/boot/docs/howto/dataaccess/configuretwodatasources/MyCompleteDataSourcesConfigurationTests.java @@ -32,14 +32,14 @@ import org.springframework.test.context.junit.jupiter.SpringExtension; import static org.assertj.core.api.Assertions.assertThat; /** - * Tests for {@link CompleteDataSourcesConfiguration}. + * Tests for {@link MyCompleteDataSourcesConfiguration}. * * @author Stephane Nicoll */ @ExtendWith(SpringExtension.class) @SpringBootTest -@Import(CompleteDataSourcesConfiguration.class) -class CompleteDataSourcesConfigurationTests { +@Import(MyCompleteDataSourcesConfiguration.class) +class MyCompleteDataSourcesConfigurationTests { @Autowired private ApplicationContext context; diff --git a/spring-boot-project/spring-boot-docs/src/test/java/org/springframework/boot/docs/howto/dataaccess/configuretwodatasources/SimpleDataSourcesConfigurationTests.java b/spring-boot-project/spring-boot-docs/src/test/java/org/springframework/boot/docs/howto/dataaccess/configuretwodatasources/MyDataSourcesConfigurationTests.java similarity index 93% rename from spring-boot-project/spring-boot-docs/src/test/java/org/springframework/boot/docs/howto/dataaccess/configuretwodatasources/SimpleDataSourcesConfigurationTests.java rename to spring-boot-project/spring-boot-docs/src/test/java/org/springframework/boot/docs/howto/dataaccess/configuretwodatasources/MyDataSourcesConfigurationTests.java index c5b7dc05b5..6034bae765 100644 --- a/spring-boot-project/spring-boot-docs/src/test/java/org/springframework/boot/docs/howto/dataaccess/configuretwodatasources/SimpleDataSourcesConfigurationTests.java +++ b/spring-boot-project/spring-boot-docs/src/test/java/org/springframework/boot/docs/howto/dataaccess/configuretwodatasources/MyDataSourcesConfigurationTests.java @@ -33,15 +33,15 @@ import org.springframework.test.context.junit.jupiter.SpringExtension; import static org.assertj.core.api.Assertions.assertThat; /** - * Tests for {@link SimpleDataSourcesConfiguration}. + * Tests for {@link MyDataSourcesConfiguration}. * * @author Stephane Nicoll */ @ExtendWith(SpringExtension.class) @SpringBootTest(properties = { "app.datasource.second.url=jdbc:h2:mem:bar;DB_CLOSE_DELAY=-1", "app.datasource.second.max-total=42" }) -@Import(SimpleDataSourcesConfiguration.class) -class SimpleDataSourcesConfigurationTests { +@Import(MyDataSourcesConfiguration.class) +class MyDataSourcesConfigurationTests { @Autowired private ApplicationContext context; diff --git a/spring-boot-project/spring-boot-docs/src/test/java/org/springframework/boot/docs/howto/webserver/usetomcatlegacycookieprocessor/LegacyCookieProcessorConfigurationTests.java b/spring-boot-project/spring-boot-docs/src/test/java/org/springframework/boot/docs/howto/webserver/usetomcatlegacycookieprocessor/MyLegacyCookieProcessorConfigurationTests.java similarity index 91% rename from spring-boot-project/spring-boot-docs/src/test/java/org/springframework/boot/docs/howto/webserver/usetomcatlegacycookieprocessor/LegacyCookieProcessorConfigurationTests.java rename to spring-boot-project/spring-boot-docs/src/test/java/org/springframework/boot/docs/howto/webserver/usetomcatlegacycookieprocessor/MyLegacyCookieProcessorConfigurationTests.java index c481483b91..29fde8b168 100644 --- a/spring-boot-project/spring-boot-docs/src/test/java/org/springframework/boot/docs/howto/webserver/usetomcatlegacycookieprocessor/LegacyCookieProcessorConfigurationTests.java +++ b/spring-boot-project/spring-boot-docs/src/test/java/org/springframework/boot/docs/howto/webserver/usetomcatlegacycookieprocessor/MyLegacyCookieProcessorConfigurationTests.java @@ -31,16 +31,16 @@ import org.springframework.context.annotation.Configuration; import static org.assertj.core.api.Assertions.assertThat; /** - * Tests for {@link LegacyCookieProcessorConfiguration}. + * Tests for {@link MyLegacyCookieProcessorConfiguration}. * * @author Andy Wilkinson */ -class LegacyCookieProcessorConfigurationTests { +class MyLegacyCookieProcessorConfigurationTests { @Test void cookieProcessorIsCustomized() { ServletWebServerApplicationContext applicationContext = (ServletWebServerApplicationContext) new SpringApplication( - TestConfiguration.class, LegacyCookieProcessorConfiguration.class).run(); + TestConfiguration.class, MyLegacyCookieProcessorConfiguration.class).run(); Context context = (Context) ((TomcatWebServer) applicationContext.getWebServer()).getTomcat().getHost() .findChildren()[0]; assertThat(context.getCookieProcessor()).isInstanceOf(LegacyCookieProcessor.class); diff --git a/src/checkstyle/checkstyle-suppressions.xml b/src/checkstyle/checkstyle-suppressions.xml index 8b2f24cef1..c9553cb27b 100644 --- a/src/checkstyle/checkstyle-suppressions.xml +++ b/src/checkstyle/checkstyle-suppressions.xml @@ -19,6 +19,7 @@ + @@ -32,7 +33,6 @@ - @@ -50,5 +50,4 @@ -