From 91ccc2346263583dccb4e0efb85303dba28d9a34 Mon Sep 17 00:00:00 2001 From: Phillip Webb Date: Tue, 2 Feb 2021 11:20:32 -0800 Subject: [PATCH] Restructure spring-boot-docs packages Restructure the packages in `spring-boot-docs` so that they mirror the documentation sections. There are now three main packages: `springbootfeatures`, `productionreadyfeatures` and `howto`. Each of the main packages has a subpackage named after the section headings. Example code now uses consistent `// tag::` names and imports are applied using `[tag=*]` whenever possible. Test snippets have been moved to `src/main/java` so that only a single import attribute needs to be defined. Closes gh-25089 --- .../src/docs/asciidoc/attributes.adoc | 9 ++- .../src/docs/asciidoc/howto.adoc | 34 +++++----- .../asciidoc/production-ready-features.adoc | 12 ++-- .../docs/asciidoc/spring-boot-features.adoc | 62 +++++++++---------- .../MetricsHealthMicrometerExportExample.java | 8 +-- .../docs/howto/actuator/package-info.java | 20 ++++++ .../howto/batchapplications/package-info.java | 20 ++++++ .../boot/docs/howto/build/package-info.java | 20 ++++++ .../dataaccess}/BasicDataSourceExample.java | 8 +-- ...veSpringPhysicalNamingStrategyExample.java | 8 +-- .../CompleteTwoDataSourcesExample.java | 8 +-- .../ConfigurableDataSourceExample.java | 8 +-- .../HibernateSearchElasticsearchExample.java | 8 +-- .../HibernateSecondLevelCacheExample.java | 8 +-- .../R2dbcDatabaseInitializationExample.java | 8 +-- .../dataaccess}/SimpleDataSourceExample.java | 8 +-- .../SimpleTwoDataSourcesExample.java | 8 +-- .../docs/howto/dataaccess/package-info.java | 20 ++++++ .../databaseinitialization/package-info.java | 20 ++++++ .../TomcatLegacyCookieProcessorExample.java | 8 +-- .../TomcatMultipleConnectorsExample.java | 6 +- .../UndertowMultipleListenersExample.java | 6 +- .../embeddedwebservers/package-info.java | 20 ++++++ .../docs/howto/hotswapping/package-info.java | 20 ++++++ ...eactorNettyClientCustomizationExample.java | 8 +-- .../docs/howto/httpclients/package-info.java | 20 ++++++ .../JerseySetStatusOverSendErrorExample.java | 8 +-- .../boot/docs/howto/jersey/package-info.java | 20 ++++++ .../boot/docs/howto/logging/package-info.java | 20 ++++++ .../docs/howto/messaging/package-info.java | 20 ++++++ .../package-info.java | 20 ++++++ .../docs/howto/security/package-info.java | 20 ++++++ .../EnvironmentPostProcessorExample.java | 13 ++-- .../springbootapplication/package-info.java | 20 ++++++ .../docs/howto/springmvc/package-info.java | 20 ++++++ .../package-info.java | 20 ++++++ .../traditionaldeployment/package-info.java | 20 ++++++ .../auditing/package-info.java | 20 ++++++ .../CloudFoundryCustomContextPathExample.java | 8 +-- .../cloudfoundry/package-info.java | 20 ++++++ .../enabling/package-info.java | 21 +++++++ .../endpoints}/CustomEndpointExample.java | 12 +++- .../endpoints/package-info.java | 20 ++++++ .../httptracing/package-info.java | 20 ++++++ .../loggers/package-info.java | 20 ++++++ .../metrics/MetricsFilterBeanExample.java | 8 +-- .../MetricsMeterRegistryInjectionExample.java | 10 +-- .../SampleMeterBinderConfiguration.java | 8 +-- .../metrics/package-info.java | 20 ++++++ .../monitoring/http/package-info.java | 21 +++++++ .../monitoring/jmx/package-info.java | 21 +++++++ .../processmonitoring/package-info.java | 20 ++++++ .../caching/package-info.java | 20 ++++++ .../containerimages/package-info.java | 20 ++++++ .../UserService.java | 4 +- .../UserServiceAutoConfiguration.java | 6 +- .../package-info.java | 20 ++++++ .../email/package-info.java | 20 ++++++ .../constructorbinding}/AppIoProperties.java | 8 +-- .../javabeanbinding}/AppIoProperties.java | 8 +-- .../AppSystemProperties.java | 8 +-- .../javabeanbinding}/AppSystemProperties.java | 8 +-- .../package-info.java | 20 ++++++ .../gracefulshutdown/package-info.java | 20 ++++++ .../hazelcast/package-info.java | 20 ++++++ .../integration/package-info.java | 20 ++++++ .../internationalization/package-info.java | 20 ++++++ .../springbootfeatures/json/package-info.java | 20 ++++++ .../springbootfeatures/jta/package-info.java | 20 ++++++ .../kotlin/package-info.java | 20 ++++++ .../logging/package-info.java | 20 ++++++ .../messaging}/KafkaStreamsBeanExample.java | 8 +-- .../messaging/package-info.java | 20 ++++++ .../monitoring/jmx/package-info.java | 20 ++++++ ...hbaseCacheManagerCustomizationExample.java | 8 +-- ...eo4jReactiveTransactionManagerExample.java | 8 +-- ...RedisCacheManagerCustomizationExample.java | 8 +-- .../nosql/package-info.java | 20 ++++++ .../profiles/package-info.java | 20 ++++++ .../quartz/package-info.java | 20 ++++++ ...stTemplateBuilderCustomizationExample.java | 8 +-- ...RestTemplateProxyCustomizationExample.java | 8 +-- .../resttemplate/package-info.java | 21 +++++++ .../rsocket/package-info.java | 20 ++++++ .../CustomWebFluxSecurityExample.java | 8 +-- .../security/package-info.java | 20 ++++++ .../session/package-info.java | 20 ++++++ .../springapplication/ExitCodeExample.java} | 12 ++-- .../SpringApplicationBuilderExample.java | 8 +-- .../springapplication/package-info.java | 20 ++++++ .../springbootfeatures/sql/package-info.java | 20 ++++++ .../springbootfeatures/task/package-info.java | 20 ++++++ .../ApplicationArgumentsExampleTests.java | 8 +-- .../testing}/MockMvcExampleTests.java | 8 +-- .../MockWebTestClientExampleTests.java | 8 +-- .../testing}/OutputCaptureTests.java | 8 +-- ...andomPortTestRestTemplateExampleTests.java | 8 +-- .../RandomPortWebTestClientExampleTests.java | 8 +-- .../UserServiceAutoConfigurationTests.java | 6 +- .../testing}/jmx/SampleApp.java | 4 +- .../testing}/jmx/SampleJmxTests.java | 8 +-- .../testing/package-info.java | 20 ++++++ .../AdvancedConfigurationExample.java | 8 +-- .../restassured/UserDocumentationTests.java | 8 +-- .../AdvancedConfigurationExample.java | 8 +-- .../webclient/UsersDocumentationTests.java | 8 +-- .../SampleWebClientConfiguration.java | 4 +- .../webclient}/SampleWebClientTests.java | 8 +-- .../validation/package-info.java | 20 ++++++ .../TomcatServerCustomizerExample.java | 6 +- .../webapplications/package-info.java | 20 ++++++ .../webclient/package-info.java | 20 ++++++ .../websockets/package-info.java | 20 ++++++ ...mcatLegacyCookieProcessorExampleTests.java | 5 +- ...icsHealthMicrometerExportExampleTests.java | 4 +- .../BasicDataSourceExampleTests.java | 4 +- .../CompleteTwoDataSourcesExampleTests.java | 4 +- .../ConfigurableDataSourceExampleTests.java | 4 +- .../{jdbc => howto/dataaccess}/SampleApp.java | 4 +- .../SimpleDataSourceExampleTests.java | 4 +- .../SimpleTwoDataSourcesExampleTests.java | 4 +- .../EnvironmentPostProcessorExampleTests.java | 4 +- .../AppSystemPropertiesTests.java | 4 +- .../AppSystemPropertiesTests.java | 4 +- .../SpringApplicationBuilderExampleTests.java | 4 +- .../testing/OutputCaptureTestsTests.java | 26 ++++++++ ...serServiceAutoConfigurationTestsTests.java | 26 ++++++++ .../testing/jmx/SampleJmxTestsTests.java | 26 ++++++++ .../webclient/SampleWebClientTestsTests.java | 26 ++++++++ 129 files changed, 1540 insertions(+), 283 deletions(-) rename spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/{actuate/metrics => howto/actuator}/MetricsHealthMicrometerExportExample.java (91%) create mode 100644 spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/howto/actuator/package-info.java create mode 100644 spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/howto/batchapplications/package-info.java create mode 100644 spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/howto/build/package-info.java rename spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/{jdbc => howto/dataaccess}/BasicDataSourceExample.java (89%) rename spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/{jpa => howto/dataaccess}/CaseSensitiveSpringPhysicalNamingStrategyExample.java (88%) rename spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/{jdbc => howto/dataaccess}/CompleteTwoDataSourcesExample.java (93%) rename spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/{jdbc => howto/dataaccess}/ConfigurableDataSourceExample.java (92%) rename spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/{elasticsearch => howto/dataaccess}/HibernateSearchElasticsearchExample.java (89%) rename spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/{jpa => howto/dataaccess}/HibernateSecondLevelCacheExample.java (90%) rename spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/{r2dbc => howto/dataaccess}/R2dbcDatabaseInitializationExample.java (91%) rename spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/{jdbc => howto/dataaccess}/SimpleDataSourceExample.java (90%) rename spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/{jdbc => howto/dataaccess}/SimpleTwoDataSourcesExample.java (93%) create mode 100644 spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/howto/dataaccess/package-info.java create mode 100644 spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/howto/databaseinitialization/package-info.java rename spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/{context/embedded => howto/embeddedwebservers}/TomcatLegacyCookieProcessorExample.java (90%) rename spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/{context/embedded => howto/embeddedwebservers}/TomcatMultipleConnectorsExample.java (95%) rename spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/{context/embedded => howto/embeddedwebservers}/UndertowMultipleListenersExample.java (93%) create mode 100644 spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/howto/embeddedwebservers/package-info.java create mode 100644 spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/howto/hotswapping/package-info.java rename spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/{web/reactive/function/client => howto/httpclients}/ReactorNettyClientCustomizationExample.java (90%) create mode 100644 spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/howto/httpclients/package-info.java rename spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/{ => howto}/jersey/JerseySetStatusOverSendErrorExample.java (89%) create mode 100644 spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/howto/jersey/package-info.java create mode 100644 spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/howto/logging/package-info.java create mode 100644 spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/howto/messaging/package-info.java create mode 100644 spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/howto/propertiesandconfiguration/package-info.java create mode 100644 spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/howto/security/package-info.java rename spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/{context => howto/springbootapplication}/EnvironmentPostProcessorExample.java (87%) create mode 100644 spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/howto/springbootapplication/package-info.java create mode 100644 spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/howto/springmvc/package-info.java create mode 100644 spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/howto/testingwithspringsecurity/package-info.java create mode 100644 spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/howto/traditionaldeployment/package-info.java create mode 100644 spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/productionreadyfeatures/auditing/package-info.java rename spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/{ => productionreadyfeatures}/cloudfoundry/CloudFoundryCustomContextPathExample.java (94%) create mode 100644 spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/productionreadyfeatures/cloudfoundry/package-info.java create mode 100644 spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/productionreadyfeatures/enabling/package-info.java rename spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/{actuate/endpoint => productionreadyfeatures/endpoints}/CustomEndpointExample.java (85%) create mode 100644 spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/productionreadyfeatures/endpoints/package-info.java create mode 100644 spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/productionreadyfeatures/httptracing/package-info.java create mode 100644 spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/productionreadyfeatures/loggers/package-info.java rename spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/{actuate => productionreadyfeatures}/metrics/MetricsFilterBeanExample.java (87%) rename spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/{actuate => productionreadyfeatures}/metrics/MetricsMeterRegistryInjectionExample.java (86%) rename spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/{actuate => productionreadyfeatures}/metrics/SampleMeterBinderConfiguration.java (87%) create mode 100644 spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/productionreadyfeatures/metrics/package-info.java create mode 100644 spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/productionreadyfeatures/monitoring/http/package-info.java create mode 100644 spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/productionreadyfeatures/monitoring/jmx/package-info.java create mode 100644 spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/productionreadyfeatures/processmonitoring/package-info.java create mode 100644 spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/springbootfeatures/caching/package-info.java create mode 100644 spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/springbootfeatures/containerimages/package-info.java rename spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/{autoconfigure => springbootfeatures/creatingautoconfiguration}/UserService.java (85%) rename spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/{autoconfigure => springbootfeatures/creatingautoconfiguration}/UserServiceAutoConfiguration.java (85%) create mode 100644 spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/springbootfeatures/creatingautoconfiguration/package-info.java create mode 100644 spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/springbootfeatures/email/package-info.java rename spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/{context/properties/bind/constructor => springbootfeatures/externalizedconfiguration/datasize/constructorbinding}/AppIoProperties.java (89%) rename spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/{context/properties/bind/javabean => springbootfeatures/externalizedconfiguration/datasize/javabeanbinding}/AppIoProperties.java (88%) rename spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/{context/properties/bind/constructor => springbootfeatures/externalizedconfiguration/duration/constructorbinding}/AppSystemProperties.java (89%) rename spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/{context/properties/bind/javabean => springbootfeatures/externalizedconfiguration/duration/javabeanbinding}/AppSystemProperties.java (88%) create mode 100644 spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/springbootfeatures/externalizedconfiguration/package-info.java create mode 100644 spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/springbootfeatures/gracefulshutdown/package-info.java create mode 100644 spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/springbootfeatures/hazelcast/package-info.java create mode 100644 spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/springbootfeatures/integration/package-info.java create mode 100644 spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/springbootfeatures/internationalization/package-info.java create mode 100644 spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/springbootfeatures/json/package-info.java create mode 100644 spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/springbootfeatures/jta/package-info.java create mode 100644 spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/springbootfeatures/kotlin/package-info.java create mode 100644 spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/springbootfeatures/logging/package-info.java rename spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/{kafka => springbootfeatures/messaging}/KafkaStreamsBeanExample.java (91%) create mode 100644 spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/springbootfeatures/messaging/package-info.java create mode 100644 spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/springbootfeatures/monitoring/jmx/package-info.java rename spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/{cache => springbootfeatures/nosql}/CouchbaseCacheManagerCustomizationExample.java (91%) rename spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/{neo4j => springbootfeatures/nosql}/Neo4jReactiveTransactionManagerExample.java (90%) rename spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/{cache => springbootfeatures/nosql}/RedisCacheManagerCustomizationExample.java (90%) create mode 100644 spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/springbootfeatures/nosql/package-info.java create mode 100644 spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/springbootfeatures/profiles/package-info.java create mode 100644 spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/springbootfeatures/quartz/package-info.java rename spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/{web/client => springbootfeatures/resttemplate}/RestTemplateBuilderCustomizationExample.java (89%) rename spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/{web/client => springbootfeatures/resttemplate}/RestTemplateProxyCustomizationExample.java (92%) create mode 100644 spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/springbootfeatures/resttemplate/package-info.java create mode 100644 spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/springbootfeatures/rsocket/package-info.java rename spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/{web => springbootfeatures}/security/CustomWebFluxSecurityExample.java (90%) create mode 100644 spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/springbootfeatures/security/package-info.java create mode 100644 spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/springbootfeatures/session/package-info.java rename spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/{ExitCodeApplication.java => springbootfeatures/springapplication/ExitCodeExample.java} (83%) rename spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/{builder => springbootfeatures/springapplication}/SpringApplicationBuilderExample.java (87%) create mode 100644 spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/springbootfeatures/springapplication/package-info.java create mode 100644 spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/springbootfeatures/sql/package-info.java create mode 100644 spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/springbootfeatures/task/package-info.java rename spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/{test/context => springbootfeatures/testing}/ApplicationArgumentsExampleTests.java (88%) rename spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/{test/web => springbootfeatures/testing}/MockMvcExampleTests.java (90%) rename spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/{test/web => springbootfeatures/testing}/MockWebTestClientExampleTests.java (86%) rename spring-boot-project/spring-boot-docs/src/{test/java/org/springframework/boot/docs/test/system => main/java/org/springframework/boot/docs/springbootfeatures/testing}/OutputCaptureTests.java (88%) rename spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/{test/web => springbootfeatures/testing}/RandomPortTestRestTemplateExampleTests.java (88%) rename spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/{test/web => springbootfeatures/testing}/RandomPortWebTestClientExampleTests.java (88%) rename spring-boot-project/spring-boot-docs/src/{test/java/org/springframework/boot/docs/autoconfigure => main/java/org/springframework/boot/docs/springbootfeatures/testing}/UserServiceAutoConfigurationTests.java (88%) rename spring-boot-project/spring-boot-docs/src/{test/java/org/springframework/boot/docs => main/java/org/springframework/boot/docs/springbootfeatures/testing}/jmx/SampleApp.java (89%) rename spring-boot-project/spring-boot-docs/src/{test/java/org/springframework/boot/docs => main/java/org/springframework/boot/docs/springbootfeatures/testing}/jmx/SampleJmxTests.java (89%) create mode 100644 spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/springbootfeatures/testing/package-info.java rename spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/{test/autoconfigure => springbootfeatures/testing}/restdocs/restassured/AdvancedConfigurationExample.java (87%) rename spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/{test/autoconfigure => springbootfeatures/testing}/restdocs/restassured/UserDocumentationTests.java (89%) rename spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/{test/autoconfigure => springbootfeatures/testing}/restdocs/webclient/AdvancedConfigurationExample.java (86%) rename spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/{test/autoconfigure => springbootfeatures/testing}/restdocs/webclient/UsersDocumentationTests.java (88%) rename spring-boot-project/spring-boot-docs/src/{test/java/org/springframework/boot/docs/web/client => main/java/org/springframework/boot/docs/springbootfeatures/testing/webclient}/SampleWebClientConfiguration.java (93%) rename spring-boot-project/spring-boot-docs/src/{test/java/org/springframework/boot/docs/web/client => main/java/org/springframework/boot/docs/springbootfeatures/testing/webclient}/SampleWebClientTests.java (92%) create mode 100644 spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/springbootfeatures/validation/package-info.java rename spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/{context/embedded => springbootfeatures/webapplications}/TomcatServerCustomizerExample.java (92%) create mode 100644 spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/springbootfeatures/webapplications/package-info.java create mode 100644 spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/springbootfeatures/webclient/package-info.java create mode 100644 spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/springbootfeatures/websockets/package-info.java rename spring-boot-project/spring-boot-docs/src/test/java/org/springframework/boot/docs/{actuate/metrics => howto/actuator}/MetricsHealthMicrometerExportExampleTests.java (95%) rename spring-boot-project/spring-boot-docs/src/test/java/org/springframework/boot/docs/{jdbc => howto/dataaccess}/BasicDataSourceExampleTests.java (94%) rename spring-boot-project/spring-boot-docs/src/test/java/org/springframework/boot/docs/{jdbc => howto/dataaccess}/CompleteTwoDataSourcesExampleTests.java (94%) rename spring-boot-project/spring-boot-docs/src/test/java/org/springframework/boot/docs/{jdbc => howto/dataaccess}/ConfigurableDataSourceExampleTests.java (94%) rename spring-boot-project/spring-boot-docs/src/test/java/org/springframework/boot/docs/{jdbc => howto/dataaccess}/SampleApp.java (90%) rename spring-boot-project/spring-boot-docs/src/test/java/org/springframework/boot/docs/{jdbc => howto/dataaccess}/SimpleDataSourceExampleTests.java (94%) rename spring-boot-project/spring-boot-docs/src/test/java/org/springframework/boot/docs/{jdbc => howto/dataaccess}/SimpleTwoDataSourcesExampleTests.java (95%) rename spring-boot-project/spring-boot-docs/src/test/java/org/springframework/boot/docs/{context => howto/springbootapplication}/EnvironmentPostProcessorExampleTests.java (91%) rename spring-boot-project/spring-boot-docs/src/test/java/org/springframework/boot/docs/{context/properties/bind/constructor => springbootfeatures/externalizedconfiguration/duration/constructorbinding}/AppSystemPropertiesTests.java (94%) rename spring-boot-project/spring-boot-docs/src/test/java/org/springframework/boot/docs/{context/properties/bind/javabean => springbootfeatures/externalizedconfiguration/duration/javabeanbinding}/AppSystemPropertiesTests.java (94%) rename spring-boot-project/spring-boot-docs/src/test/java/org/springframework/boot/docs/{builder => springbootfeatures/springapplication}/SpringApplicationBuilderExampleTests.java (91%) create mode 100644 spring-boot-project/spring-boot-docs/src/test/java/org/springframework/boot/docs/springbootfeatures/testing/OutputCaptureTestsTests.java create mode 100644 spring-boot-project/spring-boot-docs/src/test/java/org/springframework/boot/docs/springbootfeatures/testing/UserServiceAutoConfigurationTestsTests.java create mode 100644 spring-boot-project/spring-boot-docs/src/test/java/org/springframework/boot/docs/springbootfeatures/testing/jmx/SampleJmxTestsTests.java create mode 100644 spring-boot-project/spring-boot-docs/src/test/java/org/springframework/boot/docs/springbootfeatures/testing/webclient/SampleWebClientTestsTests.java diff --git a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/attributes.adoc b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/attributes.adoc index ba0c8bc45e..ea14af6df8 100644 --- a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/attributes.adoc +++ b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/attributes.adoc @@ -20,8 +20,10 @@ :github-issues: https://github.com/{github-repo}/issues/ :github-wiki: https://github.com/{github-repo}/wiki -:code-examples: ../main/java/org/springframework/boot/docs -:test-examples: ../test/java/org/springframework/boot/docs +:include: ../main/java/org/springframework/boot/docs +:include-springbootfeatures: {include}/springbootfeatures +:include-productionreadyfeatures: {include}/productionreadyfeatures +:include-howto: {include}/howto :spring-boot-code: https://github.com/{github-repo}/tree/{github-tag} :spring-boot-api: https://docs.spring.io/spring-boot/docs/{spring-boot-version}/api @@ -94,9 +96,6 @@ :spring-session: https://spring.io/projects/spring-session :spring-webservices-docs: https://docs.spring.io/spring-ws/docs/{spring-webservices-version}/reference/ - - - :ant-docs: https://ant.apache.org/manual :dependency-management-plugin-code: https://github.com/spring-gradle-plugins/dependency-management-plugin :gradle-docs: https://docs.gradle.org/current/userguide diff --git a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/howto.adoc b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/howto.adoc index becead5f77..948369553b 100644 --- a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/howto.adoc +++ b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/howto.adoc @@ -95,7 +95,7 @@ For instance, the following example loads a YAML configuration file from the cla [source,java,indent=0] ---- -include::{code-examples}/context/EnvironmentPostProcessorExample.java[tag=example] +include::{include-howto}/springbootapplication/EnvironmentPostProcessorExample.java[tag=*] ---- TIP: The `Environment` has already been prepared with all the usual property sources that Spring Boot loads by default. @@ -931,7 +931,7 @@ You can add an `org.apache.catalina.connector.Connector` to the `TomcatServletWe [source,java,indent=0,subs="verbatim,quotes,attributes"] ---- -include::{code-examples}/context/embedded/TomcatMultipleConnectorsExample.java[tag=configuration] +include::{include-howto}/embeddedwebservers/TomcatMultipleConnectorsExample.java[tag=*] ---- @@ -951,7 +951,7 @@ To switch to the `LegacyCookieProcessor`, use an `WebServerFactoryCustomizer` be [source,java,indent=0] ---- -include::{code-examples}/context/embedded/TomcatLegacyCookieProcessorExample.java[tag=customizer] +include::{include-howto}/embeddedwebservers/TomcatLegacyCookieProcessorExample.java[tag=*] ---- @@ -978,7 +978,7 @@ Add an `UndertowBuilderCustomizer` to the `UndertowServletWebServerFactory` and [source,java,indent=0,subs="verbatim,quotes,attributes"] ---- -include::{code-examples}/context/embedded/UndertowMultipleListenersExample.java[tag=configuration] +include::{include-howto}/embeddedwebservers/UndertowMultipleListenersExample.java[tag=*] ---- @@ -1283,7 +1283,7 @@ The `jersey.config.server.response.setStatusOverSendError` property must be set [source,java,indent=0] ---- -include::{code-examples}/jersey/JerseySetStatusOverSendErrorExample.java[tag=resource-config] +include::{include-howto}/jersey/JerseySetStatusOverSendErrorExample.java[tag=*] ---- @@ -1326,7 +1326,7 @@ The following example configures `HttpComponentsClientRequestFactory` with an `H [source,java,indent=0] ---- -include::{code-examples}/web/client/RestTemplateProxyCustomizationExample.java[tag=customizer] +include::{include-springbootfeatures}/resttemplate/RestTemplateProxyCustomizationExample.java[tag=*] ---- [[howto-webclient-reactor-netty-customization]] @@ -1337,7 +1337,7 @@ The following example configures a 60 second connect timeout and adds a `ReadTim [source,java,indent=0] ---- -include::{code-examples}/web/reactive/function/client/ReactorNettyClientCustomizationExample.java[tag=custom-http-connector] +include::{include-howto}/httpclients/ReactorNettyClientCustomizationExample.java[tag=*] ---- TIP: Note the use of `ReactorResourceFactory` for the connection provider and event loop resources. @@ -1582,7 +1582,7 @@ The following example shows how to create a data source by using a `DataSourceBu [source,java,indent=0,subs="verbatim,quotes,attributes"] ---- -include::{code-examples}/jdbc/BasicDataSourceExample.java[tag=configuration] +include::{include-howto}/dataaccess/BasicDataSourceExample.java[tag=*] ---- To run an app with that `DataSource`, all you need is the connection information. @@ -1623,7 +1623,7 @@ The following example shows how create a `HikariDataSource` with `DataSourceBuil [source,java,indent=0,subs="verbatim,quotes,attributes"] ---- -include::{code-examples}/jdbc/SimpleDataSourceExample.java[tag=configuration] +include::{include-howto}/dataaccess/SimpleDataSourceExample.java[tag=*] ---- 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. @@ -1633,7 +1633,7 @@ To avoid that, you can redefine a custom `DataSourceProperties` on your custom n [source,java,indent=0,subs="verbatim,quotes,attributes"] ---- -include::{code-examples}/jdbc/ConfigurableDataSourceExample.java[tag=configuration] +include::{include-howto}/dataaccess/ConfigurableDataSourceExample.java[tag=*] ---- 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. @@ -1670,7 +1670,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::{code-examples}/jdbc/SimpleTwoDataSourcesExample.java[tag=configuration] +include::{include-howto}/dataaccess/SimpleTwoDataSourcesExample.java[tag=*] ---- TIP: `firstDataSourceProperties` has to be flagged as `@Primary` so that the database initializer feature uses your copy (if you use the initializer). @@ -1700,7 +1700,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::{code-examples}/jdbc/CompleteTwoDataSourcesExample.java[tag=configuration] +include::{include-howto}/dataaccess/CompleteTwoDataSourcesExample.java[tag=*] ---- The preceding example configures two data sources on custom namespaces with the same logic as Spring Boot would use in auto-configuration. @@ -1794,7 +1794,7 @@ This implementation provides the same table structure as Hibernate 4: all dots a [source,java,indent=0] ---- -include::{code-examples}/jpa/CaseSensitiveSpringPhysicalNamingStrategyExample.java[tag=naming-strategy] +include::{include-howto}/dataaccess/CaseSensitiveSpringPhysicalNamingStrategyExample.java[tag=*] ---- If you prefer to use Hibernate 5's default instead, set the following property: @@ -1828,7 +1828,7 @@ Then, add a `HibernatePropertiesCustomizer` bean as shown in the following examp [source,java,indent=0] ---- -include::{code-examples}/jpa/HibernateSecondLevelCacheExample.java[tag=configuration] +include::{include-howto}/dataaccess/HibernateSecondLevelCacheExample.java[tag=*] ---- This customizer will configure Hibernate to use the same `CacheManager` as the one that the application uses. @@ -1969,7 +1969,7 @@ For example, if you use Hibernate Search with Elasticsearch as its index manager [source,java,indent=0] ---- -include::{code-examples}/elasticsearch/HibernateSearchElasticsearchExample.java[tag=configuration] +include::{include-howto}/dataaccess/HibernateSearchElasticsearchExample.java[tag=*] ---- @@ -2066,7 +2066,7 @@ You can initialize the database on startup using SQL scripts as shown in the fol [source,java,indent=0] ---- -include::{code-examples}/r2dbc/R2dbcDatabaseInitializationExample.java[tag=configuration] +include::{include-howto}/dataaccess/R2dbcDatabaseInitializationExample.java[tag=*] ---- Alternatively, you can configure either <> or <> to configure a `DataSource` for you for the duration of the migration. @@ -2351,7 +2351,7 @@ The following example shows one way to write such an exporter: [source,java,indent=0,subs="verbatim,quotes,attributes"] ---- -include::{code-examples}/actuate/metrics/MetricsHealthMicrometerExportExample.java[tag=configuration] +include::{include-howto}/actuator/MetricsHealthMicrometerExportExample.java[tag=*] ---- diff --git a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/production-ready-features.adoc b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/production-ready-features.adoc index eb4cce878a..daa3d2e99a 100644 --- a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/production-ready-features.adoc +++ b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/production-ready-features.adoc @@ -463,7 +463,7 @@ The following example exposes a read operation that returns a custom object: [source,java,indent=0] ---- -include::{code-examples}/actuate/endpoint/CustomEndpointExample.java[tag=read] +include::{include-productionreadyfeatures}/endpoints/CustomEndpointExample.java[tag=read] ---- You can also write technology-specific endpoints by using `@JmxEndpoint` or `@WebEndpoint`. @@ -500,7 +500,7 @@ This can be used to invoke a write operation that takes `String name` and `int c [source,java,indent=0] ---- -include::{code-examples}/actuate/endpoint/CustomEndpointExample.java[tag=write] +include::{include-productionreadyfeatures}/endpoints/CustomEndpointExample.java[tag=write] ---- TIP: Because endpoints are technology agnostic, only simple types can be specified in the method signature. @@ -2379,14 +2379,14 @@ To register custom metrics, inject `MeterRegistry` into your component, as shown [source,java,indent=0] ---- -include::{code-examples}/actuate/metrics/MetricsMeterRegistryInjectionExample.java[tag=component] +include::{include-productionreadyfeatures}/metrics/MetricsMeterRegistryInjectionExample.java[tag=*] ---- 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::{code-examples}/actuate/metrics/SampleMeterBinderConfiguration.java[tag=example] +include::{include-productionreadyfeatures}/metrics/SampleMeterBinderConfiguration.java[tag=*] ---- 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. @@ -2404,7 +2404,7 @@ For example, if you want to rename the `mytag.region` tag to `mytag.area` for al [source,java,indent=0] ---- -include::{code-examples}/actuate/metrics/MetricsFilterBeanExample.java[tag=configuration] +include::{include-productionreadyfeatures}/metrics/MetricsFilterBeanExample.java[tag=*] ---- @@ -2622,7 +2622,7 @@ For Tomcat, the following configuration can be added: [source,java,indent=0] ---- -include::{code-examples}/cloudfoundry/CloudFoundryCustomContextPathExample.java[tag=configuration] +include::{include-productionreadyfeatures}/cloudfoundry/CloudFoundryCustomContextPathExample.java[tag=*] ---- diff --git a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/spring-boot-features.adoc b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/spring-boot-features.adoc index d39fd0e48c..5659f9bb9b 100644 --- a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/spring-boot-features.adoc +++ b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/spring-boot-features.adoc @@ -195,7 +195,7 @@ The `SpringApplicationBuilder` lets you chain together multiple method calls and [source,java,indent=0] ---- -include::{code-examples}/builder/SpringApplicationBuilderExample.java[tag=hierarchy] +include::{include-springbootfeatures}/springapplication/SpringApplicationBuilderExample.java[tag=*] ---- NOTE: There are some restrictions when creating an `ApplicationContext` hierarchy. @@ -436,7 +436,7 @@ This exit code can then be passed to `System.exit()` to return it as a status co [source,java,indent=0] ---- -include::{code-examples}/ExitCodeApplication.java[tag=example] +include::{include-springbootfeatures}/springapplication/ExitCodeExample.java[tag=*] ---- Also, the `ExitCodeGenerator` interface may be implemented by exceptions. @@ -1673,7 +1673,7 @@ You may want to rename your custom `ConversionService` if it is not required for [[boot-features-external-config-conversion-duration]] -===== Converting durations +===== Converting Durations Spring Boot has dedicated support for expressing durations. If you expose a `java.time.Duration` property, the following formats in application properties are available: @@ -1685,7 +1685,7 @@ Consider the following example: [source,java,indent=0] ---- -include::{code-examples}/context/properties/bind/javabean/AppSystemProperties.java[tag=example] +include::{include-springbootfeatures}/externalizedconfiguration/duration/javabeanbinding/AppSystemProperties.java[tag=*] ---- To specify a session timeout of 30 seconds, `30`, `PT30S` and `30s` are all equivalent. @@ -1708,7 +1708,7 @@ If you prefer to use constructor binding, the same properties can be exposed, as [source,java,indent=0] ---- -include::{code-examples}/context/properties/bind/constructor/AppSystemProperties.java[tag=example] +include::{include-springbootfeatures}/externalizedconfiguration/duration/constructorbinding/AppSystemProperties.java[tag=*] ---- @@ -1749,7 +1749,7 @@ Consider the following example: [source,java,indent=0] ---- -include::{code-examples}/context/properties/bind/javabean/AppIoProperties.java[tag=example] +include::{include-springbootfeatures}/externalizedconfiguration/datasize/javabeanbinding/AppIoProperties.java[tag=*] ---- To specify a buffer size of 10 megabytes, `10` and `10MB` are equivalent. @@ -1770,7 +1770,7 @@ If you prefer to use constructor binding, the same properties can be exposed, as [source,java,indent=0] ---- -include::{code-examples}/context/properties/bind/constructor/AppIoProperties.java[tag=example] +include::{include-springbootfeatures}/externalizedconfiguration/datasize/constructorbinding/AppIoProperties.java[tag=*] ---- TIP: If you are upgrading a `Long` property, make sure to define the unit (using `@DataSizeUnit`) if it isn't bytes. @@ -3515,7 +3515,7 @@ The following example shows how to customize `TomcatServletWebServerFactory` tha [source,java,indent=0,subs="verbatim,quotes,attributes"] ---- -include::{code-examples}/context/embedded/TomcatServerCustomizerExample.java[tag=configuration] +include::{include-springbootfeatures}/webapplications/TomcatServerCustomizerExample.java[tag=*] ---- @@ -3769,7 +3769,7 @@ For example, you can customize your security configuration by adding something l [source,java,indent=0] ---- -include::{code-examples}/web/security/CustomWebFluxSecurityExample.java[tag=configuration] +include::{include-springbootfeatures}/security/CustomWebFluxSecurityExample.java[tag=*] ---- @@ -4924,7 +4924,7 @@ To enable transaction management, the following bean must be defined in your con [source,java,indent=0] ---- -include::{code-examples}/neo4j/Neo4jReactiveTransactionManagerExample.java[tag=configuration] +include::{include-springbootfeatures}/nosql/Neo4jReactiveTransactionManagerExample.java[tag=*] ---- ==== @@ -5609,7 +5609,7 @@ The following example shows a customizer that configures a specific entry expira [source,java,indent=0] ---- -include::{code-examples}/cache/CouchbaseCacheManagerCustomizationExample.java[tag=configuration] +include::{include-springbootfeatures}/nosql/CouchbaseCacheManagerCustomizationExample.java[tag=*] ---- @@ -5640,7 +5640,7 @@ The following example shows a customizer that configures a specific time to live [source,java,indent=0] ---- -include::{code-examples}/cache/RedisCacheManagerCustomizationExample.java[tag=configuration] +include::{include-springbootfeatures}/nosql//RedisCacheManagerCustomizationExample.java[tag=*] ---- @@ -6208,7 +6208,7 @@ To use the factory bean, wire `StreamsBuilder` into your `@Bean` as shown in the [source,java,indent=0] ---- -include::{code-examples}/kafka/KafkaStreamsBeanExample.java[tag=configuration] +include::{include-springbootfeatures}/messaging/KafkaStreamsBeanExample.java[tag=*] ---- By default, the streams managed by the `StreamBuilder` object it creates are started automatically. @@ -6363,7 +6363,7 @@ The following example shows a customizer that configures the use of a proxy for [source,java,indent=0] ---- -include::{code-examples}/web/client/RestTemplateProxyCustomizationExample.java[tag=customizer] +include::{include-springbootfeatures}/resttemplate/RestTemplateProxyCustomizationExample.java[tag=*] ---- Finally, you can also create your own `RestTemplateBuilder` bean. @@ -6372,7 +6372,7 @@ The following example exposes a `RestTemplateBuilder` with what Spring Boot woul [source,java,indent=0] ---- -include::{code-examples}/web/client/RestTemplateBuilderCustomizationExample.java[tag=customizer] +include::{include-springbootfeatures}/resttemplate/RestTemplateBuilderCustomizationExample.java[tag=*] ---- The most extreme (and rarely used) option is to create your own `RestTemplateBuilder` bean without using a configurer. @@ -7025,7 +7025,7 @@ have `@SpringBootTest` inject them using the `args` attribute. [source,java,indent=0] ---- -include::{code-examples}/test/context/ApplicationArgumentsExampleTests.java[tag=example] +include::{include-springbootfeatures}/testing/ApplicationArgumentsExampleTests.java[tag=*] ---- @@ -7037,7 +7037,7 @@ If you have web endpoints that you want to test against this mock environment, y [source,java,indent=0] ---- -include::{code-examples}/test/web/MockMvcExampleTests.java[tag=test-mock-mvc] +include::{include-springbootfeatures}/testing/MockMvcExampleTests.java[tag=*] ---- TIP: If you want to focus only on the web layer and not start a complete `ApplicationContext`, consider <>. @@ -7046,7 +7046,7 @@ Alternatively, you can configure a {spring-framework-docs}/testing.html#webtestc [source,java,indent=0] ---- -include::{code-examples}/test/web/MockWebTestClientExampleTests.java[tag=test-mock-web-test-client] +include::{include-springbootfeatures}/testing/MockWebTestClientExampleTests.java[tag=*] ---- [TIP] @@ -7071,7 +7071,7 @@ For convenience, tests that need to make REST calls to the started server can ad [source,java,indent=0] ---- -include::{code-examples}/test/web/RandomPortWebTestClientExampleTests.java[tag=test-random-port] +include::{include-springbootfeatures}/testing/RandomPortWebTestClientExampleTests.java[tag=*] ---- This setup requires `spring-webflux` on the classpath. @@ -7079,7 +7079,7 @@ If you can't or won't add webflux, Spring Boot also provides a `TestRestTemplate [source,java,indent=0] ---- -include::{code-examples}/test/web/RandomPortTestRestTemplateExampleTests.java[tag=test-random-port] +include::{include-springbootfeatures}/testing/RandomPortTestRestTemplateExampleTests.java[tag=*] ---- @@ -7098,7 +7098,7 @@ If such test needs access to an `MBeanServer`, consider marking it dirty as well [source,java,indent=0] ---- -include::{test-examples}/jmx/SampleJmxTests.java[tag=test] +include::{include-springbootfeatures}/testing/jmx/SampleJmxTests.java[tag=*] ---- @@ -7921,14 +7921,14 @@ You can inject it by using `@Autowired` and use it in your tests as you normally [source,java,indent=0] ---- -include::{code-examples}/test/autoconfigure/restdocs/webclient/UsersDocumentationTests.java[tag=source] +include::{include-springbootfeatures}/testing/restdocs/webclient/UsersDocumentationTests.java[tag=*] ---- 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::{code-examples}/test/autoconfigure/restdocs/webclient/AdvancedConfigurationExample.java[tag=configuration] +include::{include-springbootfeatures}/testing/restdocs/webclient/AdvancedConfigurationExample.java[tag=*] ---- @@ -7940,14 +7940,14 @@ You can inject it by using `@Autowired` and use it in your tests as you normally [source,java,indent=0] ---- -include::{code-examples}/test/autoconfigure/restdocs/restassured/UserDocumentationTests.java[tag=source] +include::{include-springbootfeatures}/testing/restdocs/restassured/UserDocumentationTests.java[tag=*] ---- 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::{code-examples}/test/autoconfigure/restdocs/restassured/AdvancedConfigurationExample.java[tag=configuration] +include::{include-springbootfeatures}/testing/restdocs/restassured/AdvancedConfigurationExample.java[tag=*] ---- @@ -8141,7 +8141,7 @@ To use add `@ExtendWith(OutputCaptureExtension.class)` and inject `CapturedOutpu [source,java,indent=0] ---- -include::{test-examples}/test/system/OutputCaptureTests.java[tag=test] +include::{include-springbootfeatures}/testing/OutputCaptureTests.java[tag=*] ---- @@ -8186,7 +8186,7 @@ Any URLs that do not specify a host and port automatically connect to the embedd [source,java,indent=0] ---- -include::{test-examples}/web/client/SampleWebClientTests.java[tag=test] +include::{include-springbootfeatures}/testing/webclient/SampleWebClientTests.java[tag=*] ---- @@ -8450,7 +8450,7 @@ The following example makes sure that `UserServiceAutoConfiguration` is always i [source,java,indent=0] ---- -include::{test-examples}/autoconfigure/UserServiceAutoConfigurationTests.java[tag=runner] +include::{include-springbootfeatures}/testing/UserServiceAutoConfigurationTests.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. @@ -8461,14 +8461,14 @@ Invoking `run` provides a callback context that can be used with `AssertJ`. [source,java,indent=0] ---- -include::{test-examples}/autoconfigure/UserServiceAutoConfigurationTests.java[tag=test-user-config] +include::{include-springbootfeatures}/testing/UserServiceAutoConfigurationTests.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::{test-examples}/autoconfigure/UserServiceAutoConfigurationTests.java[tag=test-env] +include::{include-springbootfeatures}/testing/UserServiceAutoConfigurationTests.java[tag=test-env] ---- The runner can also be used to display the `ConditionEvaluationReport`. @@ -8502,7 +8502,7 @@ In the following example, we assert that if `UserService` is not present, the au [source,java,indent=0] ---- -include::{test-examples}/autoconfigure/UserServiceAutoConfigurationTests.java[tag=test-classloader] +include::{include-springbootfeatures}/testing/UserServiceAutoConfigurationTests.java[tag=test-classloader] ---- diff --git a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/actuate/metrics/MetricsHealthMicrometerExportExample.java b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/howto/actuator/MetricsHealthMicrometerExportExample.java similarity index 91% rename from spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/actuate/metrics/MetricsHealthMicrometerExportExample.java rename to spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/howto/actuator/MetricsHealthMicrometerExportExample.java index 531de976ad..da10ce4cd9 100644 --- a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/actuate/metrics/MetricsHealthMicrometerExportExample.java +++ b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/howto/actuator/MetricsHealthMicrometerExportExample.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2020 the original author or authors. + * 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. @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.docs.actuate.metrics; +package org.springframework.boot.docs.howto.actuator; import io.micrometer.core.instrument.Gauge; import io.micrometer.core.instrument.MeterRegistry; @@ -31,7 +31,7 @@ import org.springframework.context.annotation.Configuration; */ public class MetricsHealthMicrometerExportExample { - // tag::configuration[] + // tag::code[] @Configuration public class HealthMetricsConfiguration { @@ -55,6 +55,6 @@ public class MetricsHealthMicrometerExportExample { } } - // end::configuration[] + // end::code[] } diff --git a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/howto/actuator/package-info.java b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/howto/actuator/package-info.java new file mode 100644 index 0000000000..b48bb91aef --- /dev/null +++ b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/howto/actuator/package-info.java @@ -0,0 +1,20 @@ +/* + * 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. + */ + +/** + * Examples for the "How-to - Actuator" section. + */ +package org.springframework.boot.docs.howto.actuator; diff --git a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/howto/batchapplications/package-info.java b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/howto/batchapplications/package-info.java new file mode 100644 index 0000000000..ea999e25c1 --- /dev/null +++ b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/howto/batchapplications/package-info.java @@ -0,0 +1,20 @@ +/* + * 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. + */ + +/** + * Examples for the "How-to - Batch Applications" section. + */ +package org.springframework.boot.docs.howto.batchapplications; diff --git a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/howto/build/package-info.java b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/howto/build/package-info.java new file mode 100644 index 0000000000..d32b645817 --- /dev/null +++ b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/howto/build/package-info.java @@ -0,0 +1,20 @@ +/* + * 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. + */ + +/** + * Examples for the "How-to - Build" section. + */ +package org.springframework.boot.docs.howto.build; diff --git a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/jdbc/BasicDataSourceExample.java b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/howto/dataaccess/BasicDataSourceExample.java similarity index 89% rename from spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/jdbc/BasicDataSourceExample.java rename to spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/howto/dataaccess/BasicDataSourceExample.java index 674c361e64..7ffb6e3873 100644 --- a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/jdbc/BasicDataSourceExample.java +++ b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/howto/dataaccess/BasicDataSourceExample.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * 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. @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.docs.jdbc; +package org.springframework.boot.docs.howto.dataaccess; import javax.sql.DataSource; @@ -36,13 +36,13 @@ public class BasicDataSourceExample { @Configuration(proxyBeanMethods = false) public static class BasicDataSourceConfiguration { - // tag::configuration[] + // tag::code[] @Bean @ConfigurationProperties("app.datasource") public DataSource dataSource() { return DataSourceBuilder.create().build(); } - // end::configuration[] + // end::code[] } diff --git a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/jpa/CaseSensitiveSpringPhysicalNamingStrategyExample.java b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/howto/dataaccess/CaseSensitiveSpringPhysicalNamingStrategyExample.java similarity index 88% rename from spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/jpa/CaseSensitiveSpringPhysicalNamingStrategyExample.java rename to spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/howto/dataaccess/CaseSensitiveSpringPhysicalNamingStrategyExample.java index d8c34d71fd..27e44dd5c1 100644 --- a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/jpa/CaseSensitiveSpringPhysicalNamingStrategyExample.java +++ b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/howto/dataaccess/CaseSensitiveSpringPhysicalNamingStrategyExample.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2020 the original author or authors. + * 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. @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.docs.jpa; +package org.springframework.boot.docs.howto.dataaccess; import org.hibernate.engine.jdbc.env.spi.JdbcEnvironment; @@ -29,7 +29,7 @@ import org.springframework.context.annotation.Bean; */ class CaseSensitiveSpringPhysicalNamingStrategyExample { - // tag::naming-strategy[] + // tag::code[] @Bean SpringPhysicalNamingStrategy caseSensitivePhysicalNamingStrategy() { return new SpringPhysicalNamingStrategy() { @@ -41,6 +41,6 @@ class CaseSensitiveSpringPhysicalNamingStrategyExample { }; } - // end::naming-strategy[] + // end::code[] } diff --git a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/jdbc/CompleteTwoDataSourcesExample.java b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/howto/dataaccess/CompleteTwoDataSourcesExample.java similarity index 93% rename from spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/jdbc/CompleteTwoDataSourcesExample.java rename to spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/howto/dataaccess/CompleteTwoDataSourcesExample.java index 7526b6331d..824dc54907 100644 --- a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/jdbc/CompleteTwoDataSourcesExample.java +++ b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/howto/dataaccess/CompleteTwoDataSourcesExample.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * 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. @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.docs.jdbc; +package org.springframework.boot.docs.howto.dataaccess; import com.zaxxer.hikari.HikariDataSource; import org.apache.commons.dbcp2.BasicDataSource; @@ -39,7 +39,7 @@ public class CompleteTwoDataSourcesExample { @Configuration public static class CompleteDataSourcesConfiguration { - // tag::configuration[] + // tag::code[] @Bean @Primary @ConfigurationProperties("app.datasource.first") @@ -65,7 +65,7 @@ public class CompleteTwoDataSourcesExample { public BasicDataSource secondDataSource() { return secondDataSourceProperties().initializeDataSourceBuilder().type(BasicDataSource.class).build(); } - // end::configuration[] + // end::code[] } diff --git a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/jdbc/ConfigurableDataSourceExample.java b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/howto/dataaccess/ConfigurableDataSourceExample.java similarity index 92% rename from spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/jdbc/ConfigurableDataSourceExample.java rename to spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/howto/dataaccess/ConfigurableDataSourceExample.java index e9517f752f..ab38834a4c 100644 --- a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/jdbc/ConfigurableDataSourceExample.java +++ b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/howto/dataaccess/ConfigurableDataSourceExample.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * 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. @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.docs.jdbc; +package org.springframework.boot.docs.howto.dataaccess; import javax.sql.DataSource; @@ -40,7 +40,7 @@ public class ConfigurableDataSourceExample { @Configuration(proxyBeanMethods = false) public static class ConfigurableDataSourceConfiguration { - // tag::configuration[] + // tag::code[] @Bean @Primary @ConfigurationProperties("app.datasource") @@ -53,7 +53,7 @@ public class ConfigurableDataSourceExample { public HikariDataSource dataSource(DataSourceProperties properties) { return properties.initializeDataSourceBuilder().type(HikariDataSource.class).build(); } - // end::configuration[] + // end::code[] } diff --git a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/elasticsearch/HibernateSearchElasticsearchExample.java b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/howto/dataaccess/HibernateSearchElasticsearchExample.java similarity index 89% rename from spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/elasticsearch/HibernateSearchElasticsearchExample.java rename to spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/howto/dataaccess/HibernateSearchElasticsearchExample.java index 7cc9cd287a..916a116b6b 100644 --- a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/elasticsearch/HibernateSearchElasticsearchExample.java +++ b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/howto/dataaccess/HibernateSearchElasticsearchExample.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2020 the original author or authors. + * 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. @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.docs.elasticsearch; +package org.springframework.boot.docs.howto.dataaccess; import javax.persistence.EntityManagerFactory; @@ -29,7 +29,7 @@ import org.springframework.stereotype.Component; */ public class HibernateSearchElasticsearchExample { - // tag::configuration[] + // tag::code[] /** * {@link EntityManagerFactoryDependsOnPostProcessor} that ensures that * {@link EntityManagerFactory} beans depend on the {@code elasticsearchClient} bean. @@ -43,6 +43,6 @@ public class HibernateSearchElasticsearchExample { } } - // end::configuration[] + // end::code[] } diff --git a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/jpa/HibernateSecondLevelCacheExample.java b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/howto/dataaccess/HibernateSecondLevelCacheExample.java similarity index 90% rename from spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/jpa/HibernateSecondLevelCacheExample.java rename to spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/howto/dataaccess/HibernateSecondLevelCacheExample.java index 75c9bce202..b174e7a802 100644 --- a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/jpa/HibernateSecondLevelCacheExample.java +++ b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/howto/dataaccess/HibernateSecondLevelCacheExample.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * 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. @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.docs.jpa; +package org.springframework.boot.docs.howto.dataaccess; import org.hibernate.cache.jcache.ConfigSettings; @@ -28,7 +28,7 @@ import org.springframework.context.annotation.Configuration; * * @author Stephane Nicoll */ -// tag::configuration[] +// tag::code[] @Configuration(proxyBeanMethods = false) public class HibernateSecondLevelCacheExample { @@ -38,4 +38,4 @@ public class HibernateSecondLevelCacheExample { } } -// end::configuration[] +// end::code[] diff --git a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/r2dbc/R2dbcDatabaseInitializationExample.java b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/howto/dataaccess/R2dbcDatabaseInitializationExample.java similarity index 91% rename from spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/r2dbc/R2dbcDatabaseInitializationExample.java rename to spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/howto/dataaccess/R2dbcDatabaseInitializationExample.java index e5236b2b91..2dfd7b4a42 100644 --- a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/r2dbc/R2dbcDatabaseInitializationExample.java +++ b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/howto/dataaccess/R2dbcDatabaseInitializationExample.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2020 the original author or authors. + * 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. @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.docs.r2dbc; +package org.springframework.boot.docs.howto.dataaccess; import io.r2dbc.spi.ConnectionFactory; @@ -32,7 +32,7 @@ import org.springframework.r2dbc.connection.init.ResourceDatabasePopulator; */ public class R2dbcDatabaseInitializationExample { - // tag::configuration[] + // tag::code[] @Configuration(proxyBeanMethods = false) static class DatabaseInitializationConfiguration { @@ -45,6 +45,6 @@ public class R2dbcDatabaseInitializationExample { } } - // end::configuration[] + // end::code[] } diff --git a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/jdbc/SimpleDataSourceExample.java b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/howto/dataaccess/SimpleDataSourceExample.java similarity index 90% rename from spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/jdbc/SimpleDataSourceExample.java rename to spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/howto/dataaccess/SimpleDataSourceExample.java index 7dec69c4b2..3c55602513 100644 --- a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/jdbc/SimpleDataSourceExample.java +++ b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/howto/dataaccess/SimpleDataSourceExample.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * 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. @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.docs.jdbc; +package org.springframework.boot.docs.howto.dataaccess; import javax.sql.DataSource; @@ -38,13 +38,13 @@ public class SimpleDataSourceExample { @Configuration(proxyBeanMethods = false) public static class SimpleDataSourceConfiguration { - // tag::configuration[] + // tag::code[] @Bean @ConfigurationProperties("app.datasource") public HikariDataSource dataSource() { return DataSourceBuilder.create().type(HikariDataSource.class).build(); } - // end::configuration[] + // end::code[] } diff --git a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/jdbc/SimpleTwoDataSourcesExample.java b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/howto/dataaccess/SimpleTwoDataSourcesExample.java similarity index 93% rename from spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/jdbc/SimpleTwoDataSourcesExample.java rename to spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/howto/dataaccess/SimpleTwoDataSourcesExample.java index 568d465da0..99d6557590 100644 --- a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/jdbc/SimpleTwoDataSourcesExample.java +++ b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/howto/dataaccess/SimpleTwoDataSourcesExample.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * 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. @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.docs.jdbc; +package org.springframework.boot.docs.howto.dataaccess; import javax.sql.DataSource; @@ -42,7 +42,7 @@ public class SimpleTwoDataSourcesExample { @Configuration public static class SimpleDataSourcesConfiguration { - // tag::configuration[] + // tag::code[] @Bean @Primary @ConfigurationProperties("app.datasource.first") @@ -62,7 +62,7 @@ public class SimpleTwoDataSourcesExample { public BasicDataSource secondDataSource() { return DataSourceBuilder.create().type(BasicDataSource.class).build(); } - // end::configuration[] + // end::code[] } diff --git a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/howto/dataaccess/package-info.java b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/howto/dataaccess/package-info.java new file mode 100644 index 0000000000..10e523a659 --- /dev/null +++ b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/howto/dataaccess/package-info.java @@ -0,0 +1,20 @@ +/* + * 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. + */ + +/** + * Examples for the "How-to - Data Access" section. + */ +package org.springframework.boot.docs.howto.dataaccess; diff --git a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/howto/databaseinitialization/package-info.java b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/howto/databaseinitialization/package-info.java new file mode 100644 index 0000000000..612af69477 --- /dev/null +++ b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/howto/databaseinitialization/package-info.java @@ -0,0 +1,20 @@ +/* + * 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. + */ + +/** + * Examples for the "How-to - Database Initialization" section. + */ +package org.springframework.boot.docs.howto.databaseinitialization; diff --git a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/context/embedded/TomcatLegacyCookieProcessorExample.java b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/howto/embeddedwebservers/TomcatLegacyCookieProcessorExample.java similarity index 90% rename from spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/context/embedded/TomcatLegacyCookieProcessorExample.java rename to spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/howto/embeddedwebservers/TomcatLegacyCookieProcessorExample.java index f2bb5d298a..557c4a0b45 100644 --- a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/context/embedded/TomcatLegacyCookieProcessorExample.java +++ b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/howto/embeddedwebservers/TomcatLegacyCookieProcessorExample.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * 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. @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.docs.context.embedded; +package org.springframework.boot.docs.howto.embeddedwebservers; import org.apache.tomcat.util.http.LegacyCookieProcessor; @@ -36,13 +36,13 @@ public class TomcatLegacyCookieProcessorExample { @Configuration(proxyBeanMethods = false) public static class LegacyCookieProcessorConfiguration { - // tag::customizer[] + // tag::code[] @Bean public WebServerFactoryCustomizer cookieProcessorCustomizer() { return (factory) -> factory .addContextCustomizers((context) -> context.setCookieProcessor(new LegacyCookieProcessor())); } - // end::customizer[] + // end::code[] } diff --git a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/context/embedded/TomcatMultipleConnectorsExample.java b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/howto/embeddedwebservers/TomcatMultipleConnectorsExample.java similarity index 95% rename from spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/context/embedded/TomcatMultipleConnectorsExample.java rename to spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/howto/embeddedwebservers/TomcatMultipleConnectorsExample.java index b584448ed5..9608308c8e 100644 --- a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/context/embedded/TomcatMultipleConnectorsExample.java +++ b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/howto/embeddedwebservers/TomcatMultipleConnectorsExample.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.docs.context.embedded; +package org.springframework.boot.docs.howto.embeddedwebservers; import java.io.IOException; import java.net.URL; @@ -36,7 +36,7 @@ import org.springframework.util.ResourceUtils; @Configuration(proxyBeanMethods = false) public class TomcatMultipleConnectorsExample { - // tag::configuration[] + // tag::code[] @Bean public WebServerFactoryCustomizer sslConnectorCustomizer() { return (tomcat) -> tomcat.addAdditionalTomcatConnectors(createSslConnector()); @@ -63,6 +63,6 @@ public class TomcatMultipleConnectorsExample { throw new IllegalStateException("Fail to create ssl connector", ex); } } - // end::configuration[] + // end::code[] } diff --git a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/context/embedded/UndertowMultipleListenersExample.java b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/howto/embeddedwebservers/UndertowMultipleListenersExample.java similarity index 93% rename from spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/context/embedded/UndertowMultipleListenersExample.java rename to spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/howto/embeddedwebservers/UndertowMultipleListenersExample.java index bad053f8a9..94f50f4e19 100644 --- a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/context/embedded/UndertowMultipleListenersExample.java +++ b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/howto/embeddedwebservers/UndertowMultipleListenersExample.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.docs.context.embedded; +package org.springframework.boot.docs.howto.embeddedwebservers; import io.undertow.Undertow.Builder; @@ -32,7 +32,7 @@ import org.springframework.context.annotation.Configuration; @Configuration(proxyBeanMethods = false) public class UndertowMultipleListenersExample { - // tag::configuration[] + // tag::code[] @Bean public WebServerFactoryCustomizer undertowListenerCustomizer() { return (factory) -> { @@ -46,6 +46,6 @@ public class UndertowMultipleListenersExample { }); }; } - // end::configuration[] + // end::code[] } diff --git a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/howto/embeddedwebservers/package-info.java b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/howto/embeddedwebservers/package-info.java new file mode 100644 index 0000000000..39d341eda5 --- /dev/null +++ b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/howto/embeddedwebservers/package-info.java @@ -0,0 +1,20 @@ +/* + * 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. + */ + +/** + * Examples for the "How-to - Embedded Web Servers" section. + */ +package org.springframework.boot.docs.howto.embeddedwebservers; diff --git a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/howto/hotswapping/package-info.java b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/howto/hotswapping/package-info.java new file mode 100644 index 0000000000..e2a273bf01 --- /dev/null +++ b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/howto/hotswapping/package-info.java @@ -0,0 +1,20 @@ +/* + * 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. + */ + +/** + * Examples for the "How-to - Hot Swapping" section. + */ +package org.springframework.boot.docs.howto.hotswapping; diff --git a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/web/reactive/function/client/ReactorNettyClientCustomizationExample.java b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/howto/httpclients/ReactorNettyClientCustomizationExample.java similarity index 90% rename from spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/web/reactive/function/client/ReactorNettyClientCustomizationExample.java rename to spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/howto/httpclients/ReactorNettyClientCustomizationExample.java index ff2e7f9541..6290717ab8 100644 --- a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/web/reactive/function/client/ReactorNettyClientCustomizationExample.java +++ b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/howto/httpclients/ReactorNettyClientCustomizationExample.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2020 the original author or authors. + * 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. @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.docs.web.reactive.function.client; +package org.springframework.boot.docs.howto.httpclients; import io.netty.channel.ChannelOption; import io.netty.handler.timeout.ReadTimeoutHandler; @@ -35,7 +35,7 @@ import org.springframework.web.reactive.function.client.WebClient; @Configuration(proxyBeanMethods = false) public class ReactorNettyClientCustomizationExample { - // tag::custom-http-connector[] + // tag::code[] @Bean ClientHttpConnector clientHttpConnector(ReactorResourceFactory resourceFactory) { HttpClient httpClient = HttpClient.create(resourceFactory.getConnectionProvider()) @@ -43,6 +43,6 @@ public class ReactorNettyClientCustomizationExample { .doOnConnected((connection) -> connection.addHandlerLast(new ReadTimeoutHandler(60))); return new ReactorClientHttpConnector(httpClient); } - // end::custom-http-connector[] + // end::code[] } diff --git a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/howto/httpclients/package-info.java b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/howto/httpclients/package-info.java new file mode 100644 index 0000000000..d27b0e1310 --- /dev/null +++ b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/howto/httpclients/package-info.java @@ -0,0 +1,20 @@ +/* + * 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. + */ + +/** + * Examples for the "How-to - HTTP Clients" section. + */ +package org.springframework.boot.docs.howto.httpclients; diff --git a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/jersey/JerseySetStatusOverSendErrorExample.java b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/howto/jersey/JerseySetStatusOverSendErrorExample.java similarity index 89% rename from spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/jersey/JerseySetStatusOverSendErrorExample.java rename to spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/howto/jersey/JerseySetStatusOverSendErrorExample.java index 0874f9f0e7..6720bd3b91 100644 --- a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/jersey/JerseySetStatusOverSendErrorExample.java +++ b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/howto/jersey/JerseySetStatusOverSendErrorExample.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * 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. @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.docs.jersey; +package org.springframework.boot.docs.howto.jersey; import java.util.Collections; @@ -33,7 +33,7 @@ import org.springframework.stereotype.Component; */ public class JerseySetStatusOverSendErrorExample { - // tag::resource-config[] + // tag::code[] @Component public class JerseyConfig extends ResourceConfig { @@ -43,7 +43,7 @@ public class JerseySetStatusOverSendErrorExample { } } - // end::resource-config[] + // end::code[] static class Endpoint { diff --git a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/howto/jersey/package-info.java b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/howto/jersey/package-info.java new file mode 100644 index 0000000000..ef3a388de6 --- /dev/null +++ b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/howto/jersey/package-info.java @@ -0,0 +1,20 @@ +/* + * 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. + */ + +/** + * Examples for the "How-to - Jersey" section. + */ +package org.springframework.boot.docs.howto.jersey; diff --git a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/howto/logging/package-info.java b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/howto/logging/package-info.java new file mode 100644 index 0000000000..2fe9a206ea --- /dev/null +++ b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/howto/logging/package-info.java @@ -0,0 +1,20 @@ +/* + * 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. + */ + +/** + * Examples for the "How-to - Logging" section. + */ +package org.springframework.boot.docs.howto.logging; diff --git a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/howto/messaging/package-info.java b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/howto/messaging/package-info.java new file mode 100644 index 0000000000..5dea09cf3e --- /dev/null +++ b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/howto/messaging/package-info.java @@ -0,0 +1,20 @@ +/* + * 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. + */ + +/** + * Examples for the "How-to - Messaging" section. + */ +package org.springframework.boot.docs.howto.messaging; diff --git a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/howto/propertiesandconfiguration/package-info.java b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/howto/propertiesandconfiguration/package-info.java new file mode 100644 index 0000000000..dcfd0d12b2 --- /dev/null +++ b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/howto/propertiesandconfiguration/package-info.java @@ -0,0 +1,20 @@ +/* + * 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. + */ + +/** + * Examples for the "How-to - Properties and Configuration" section. + */ +package org.springframework.boot.docs.howto.propertiesandconfiguration; diff --git a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/howto/security/package-info.java b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/howto/security/package-info.java new file mode 100644 index 0000000000..bd36bd612d --- /dev/null +++ b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/howto/security/package-info.java @@ -0,0 +1,20 @@ +/* + * 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. + */ + +/** + * Examples for the "How-to - Security" section. + */ +package org.springframework.boot.docs.howto.security; diff --git a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/context/EnvironmentPostProcessorExample.java b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/howto/springbootapplication/EnvironmentPostProcessorExample.java similarity index 87% rename from spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/context/EnvironmentPostProcessorExample.java rename to spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/howto/springbootapplication/EnvironmentPostProcessorExample.java index 2bfef078e9..3b7a90b764 100644 --- a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/context/EnvironmentPostProcessorExample.java +++ b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/howto/springbootapplication/EnvironmentPostProcessorExample.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * 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. @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.docs.context; +package org.springframework.boot.docs.howto.springbootapplication; import java.io.IOException; @@ -25,13 +25,14 @@ import org.springframework.core.env.ConfigurableEnvironment; import org.springframework.core.env.PropertySource; import org.springframework.core.io.ClassPathResource; import org.springframework.core.io.Resource; +import org.springframework.util.Assert; /** * An {@link EnvironmentPostProcessor} example that loads a YAML file. * * @author Stephane Nicoll */ -// tag::example[] +// tag::code[] public class EnvironmentPostProcessorExample implements EnvironmentPostProcessor { private final YamlPropertySourceLoader loader = new YamlPropertySourceLoader(); @@ -44,9 +45,7 @@ public class EnvironmentPostProcessorExample implements EnvironmentPostProcessor } private PropertySource loadYaml(Resource path) { - if (!path.exists()) { - throw new IllegalArgumentException("Resource " + path + " does not exist"); - } + Assert.isTrue(path.exists(), () -> "Resource " + path + " does not exist"); try { return this.loader.load("custom-resource", path).get(0); } @@ -56,4 +55,4 @@ public class EnvironmentPostProcessorExample implements EnvironmentPostProcessor } } -// end::example[] +// end::code[] diff --git a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/howto/springbootapplication/package-info.java b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/howto/springbootapplication/package-info.java new file mode 100644 index 0000000000..7312f7df3a --- /dev/null +++ b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/howto/springbootapplication/package-info.java @@ -0,0 +1,20 @@ +/* + * 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. + */ + +/** + * Examples for the "How-to - Spring Boot Application" section. + */ +package org.springframework.boot.docs.howto.springbootapplication; diff --git a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/howto/springmvc/package-info.java b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/howto/springmvc/package-info.java new file mode 100644 index 0000000000..3473857d66 --- /dev/null +++ b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/howto/springmvc/package-info.java @@ -0,0 +1,20 @@ +/* + * 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. + */ + +/** + * Examples for the "How-to - Spring MVC" section. + */ +package org.springframework.boot.docs.howto.springmvc; diff --git a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/howto/testingwithspringsecurity/package-info.java b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/howto/testingwithspringsecurity/package-info.java new file mode 100644 index 0000000000..6f0a7114c6 --- /dev/null +++ b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/howto/testingwithspringsecurity/package-info.java @@ -0,0 +1,20 @@ +/* + * 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. + */ + +/** + * Examples for the "How-to - Testing with Spring Security" section. + */ +package org.springframework.boot.docs.howto.testingwithspringsecurity; diff --git a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/howto/traditionaldeployment/package-info.java b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/howto/traditionaldeployment/package-info.java new file mode 100644 index 0000000000..45cf58f6dc --- /dev/null +++ b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/howto/traditionaldeployment/package-info.java @@ -0,0 +1,20 @@ +/* + * 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. + */ + +/** + * Examples for the "How-to - Traditional Deployment" section. + */ +package org.springframework.boot.docs.howto.traditionaldeployment; diff --git a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/productionreadyfeatures/auditing/package-info.java b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/productionreadyfeatures/auditing/package-info.java new file mode 100644 index 0000000000..66e57e05fa --- /dev/null +++ b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/productionreadyfeatures/auditing/package-info.java @@ -0,0 +1,20 @@ +/* + * 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. + */ + +/** + * Examples for the "Production Ready Features - Auditing" section. + */ +package org.springframework.boot.docs.productionreadyfeatures.auditing; diff --git a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/cloudfoundry/CloudFoundryCustomContextPathExample.java b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/productionreadyfeatures/cloudfoundry/CloudFoundryCustomContextPathExample.java similarity index 94% rename from spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/cloudfoundry/CloudFoundryCustomContextPathExample.java rename to spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/productionreadyfeatures/cloudfoundry/CloudFoundryCustomContextPathExample.java index d1cbc15d5e..f9d6fcd7eb 100644 --- a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/cloudfoundry/CloudFoundryCustomContextPathExample.java +++ b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/productionreadyfeatures/cloudfoundry/CloudFoundryCustomContextPathExample.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * 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. @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.docs.cloudfoundry; +package org.springframework.boot.docs.productionreadyfeatures.cloudfoundry; import java.io.IOException; import java.util.Collections; @@ -44,7 +44,7 @@ import org.springframework.context.annotation.Configuration; @Configuration(proxyBeanMethods = false) public class CloudFoundryCustomContextPathExample { - // tag::configuration[] + // tag::code[] @Bean public TomcatServletWebServerFactory servletWebServerFactory() { return new TomcatServletWebServerFactory() { @@ -78,6 +78,6 @@ public class CloudFoundryCustomContextPathExample { context.addServlet("cloudfoundry", servlet).addMapping("/*"); }; } - // end::configuration[] + // end::code[] } diff --git a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/productionreadyfeatures/cloudfoundry/package-info.java b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/productionreadyfeatures/cloudfoundry/package-info.java new file mode 100644 index 0000000000..07dedb276e --- /dev/null +++ b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/productionreadyfeatures/cloudfoundry/package-info.java @@ -0,0 +1,20 @@ +/* + * 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. + */ + +/** + * Examples for the "Production Ready Features - Cloud Foundry Support" section. + */ +package org.springframework.boot.docs.productionreadyfeatures.cloudfoundry; diff --git a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/productionreadyfeatures/enabling/package-info.java b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/productionreadyfeatures/enabling/package-info.java new file mode 100644 index 0000000000..038f7fb39b --- /dev/null +++ b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/productionreadyfeatures/enabling/package-info.java @@ -0,0 +1,21 @@ +/* + * 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. + */ + +/** + * Examples for the "Production Ready Features - Enabling Production Ready Features" + * section. + */ +package org.springframework.boot.docs.productionreadyfeatures.enabling; diff --git a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/actuate/endpoint/CustomEndpointExample.java b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/productionreadyfeatures/endpoints/CustomEndpointExample.java similarity index 85% rename from spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/actuate/endpoint/CustomEndpointExample.java rename to spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/productionreadyfeatures/endpoints/CustomEndpointExample.java index 78674d700c..a46938dd30 100644 --- a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/actuate/endpoint/CustomEndpointExample.java +++ b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/productionreadyfeatures/endpoints/CustomEndpointExample.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2020 the original author or authors. + * 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. @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.docs.actuate.endpoint; +package org.springframework.boot.docs.productionreadyfeatures.endpoints; import org.springframework.boot.actuate.endpoint.annotation.Endpoint; import org.springframework.boot.actuate.endpoint.annotation.ReadOperation; @@ -53,6 +53,14 @@ public class CustomEndpointExample { 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/productionreadyfeatures/endpoints/package-info.java b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/productionreadyfeatures/endpoints/package-info.java new file mode 100644 index 0000000000..9f4ed9d936 --- /dev/null +++ b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/productionreadyfeatures/endpoints/package-info.java @@ -0,0 +1,20 @@ +/* + * 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. + */ + +/** + * Examples for the "Production Ready Features - Endpoints" section. + */ +package org.springframework.boot.docs.productionreadyfeatures.endpoints; diff --git a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/productionreadyfeatures/httptracing/package-info.java b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/productionreadyfeatures/httptracing/package-info.java new file mode 100644 index 0000000000..390de022b6 --- /dev/null +++ b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/productionreadyfeatures/httptracing/package-info.java @@ -0,0 +1,20 @@ +/* + * 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. + */ + +/** + * Examples for the "Production Ready Features - HTTP Tracing" section. + */ +package org.springframework.boot.docs.productionreadyfeatures.httptracing; diff --git a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/productionreadyfeatures/loggers/package-info.java b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/productionreadyfeatures/loggers/package-info.java new file mode 100644 index 0000000000..bd125de90d --- /dev/null +++ b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/productionreadyfeatures/loggers/package-info.java @@ -0,0 +1,20 @@ +/* + * 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. + */ + +/** + * Examples for the "Production Ready Features - Loggers" section. + */ +package org.springframework.boot.docs.productionreadyfeatures.loggers; diff --git a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/actuate/metrics/MetricsFilterBeanExample.java b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/productionreadyfeatures/metrics/MetricsFilterBeanExample.java similarity index 87% rename from spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/actuate/metrics/MetricsFilterBeanExample.java rename to spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/productionreadyfeatures/metrics/MetricsFilterBeanExample.java index 3c7be0c394..103ff1311e 100644 --- a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/actuate/metrics/MetricsFilterBeanExample.java +++ b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/productionreadyfeatures/metrics/MetricsFilterBeanExample.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * 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. @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.docs.actuate.metrics; +package org.springframework.boot.docs.productionreadyfeatures.metrics; import io.micrometer.core.instrument.config.MeterFilter; @@ -31,12 +31,12 @@ public class MetricsFilterBeanExample { @Configuration(proxyBeanMethods = false) public static class MetricsFilterExampleConfiguration { - // tag::configuration[] + // tag::code[] @Bean public MeterFilter renameRegionTagMeterFilter() { return MeterFilter.renameTag("com.example", "mytag.region", "mytag.area"); } - // end::configuration[] + // end::code[] } diff --git a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/actuate/metrics/MetricsMeterRegistryInjectionExample.java b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/productionreadyfeatures/metrics/MetricsMeterRegistryInjectionExample.java similarity index 86% rename from spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/actuate/metrics/MetricsMeterRegistryInjectionExample.java rename to spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/productionreadyfeatures/metrics/MetricsMeterRegistryInjectionExample.java index efb36a2e41..3845936b0e 100644 --- a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/actuate/metrics/MetricsMeterRegistryInjectionExample.java +++ b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/productionreadyfeatures/metrics/MetricsMeterRegistryInjectionExample.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * 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. @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.docs.actuate.metrics; +package org.springframework.boot.docs.productionreadyfeatures.metrics; import java.util.List; import java.util.concurrent.CopyOnWriteArrayList; @@ -29,7 +29,7 @@ import io.micrometer.core.instrument.Tags; */ public class MetricsMeterRegistryInjectionExample { - // tag::component[] + // tag::code[] class Dictionary { private final List words = new CopyOnWriteArrayList<>(); @@ -38,9 +38,9 @@ public class MetricsMeterRegistryInjectionExample { registry.gaugeCollectionSize("dictionary.size", Tags.empty(), this.words); } - // … + // ... } - // end::component[] + // end::code[] } diff --git a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/actuate/metrics/SampleMeterBinderConfiguration.java b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/productionreadyfeatures/metrics/SampleMeterBinderConfiguration.java similarity index 87% rename from spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/actuate/metrics/SampleMeterBinderConfiguration.java rename to spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/productionreadyfeatures/metrics/SampleMeterBinderConfiguration.java index 63931823d7..b289ab58cf 100644 --- a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/actuate/metrics/SampleMeterBinderConfiguration.java +++ b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/productionreadyfeatures/metrics/SampleMeterBinderConfiguration.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2020 the original author or authors. + * 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. @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.docs.actuate.metrics; +package org.springframework.boot.docs.productionreadyfeatures.metrics; import io.micrometer.core.instrument.Gauge; import io.micrometer.core.instrument.binder.MeterBinder; @@ -28,12 +28,12 @@ import org.springframework.context.annotation.Bean; */ public class SampleMeterBinderConfiguration { - // tag::example[] + // tag::code[] @Bean MeterBinder queueSize(Queue queue) { return (registry) -> Gauge.builder("queueSize", queue::size).register(registry); } - // end::example[] + // end::code[] static class Queue { diff --git a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/productionreadyfeatures/metrics/package-info.java b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/productionreadyfeatures/metrics/package-info.java new file mode 100644 index 0000000000..0db6b7dd4e --- /dev/null +++ b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/productionreadyfeatures/metrics/package-info.java @@ -0,0 +1,20 @@ +/* + * 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. + */ + +/** + * Examples for the "Production Ready Features - Metrics" section. + */ +package org.springframework.boot.docs.productionreadyfeatures.metrics; diff --git a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/productionreadyfeatures/monitoring/http/package-info.java b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/productionreadyfeatures/monitoring/http/package-info.java new file mode 100644 index 0000000000..b6856c0ea5 --- /dev/null +++ b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/productionreadyfeatures/monitoring/http/package-info.java @@ -0,0 +1,21 @@ +/* + * 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. + */ + +/** + * Examples for the "Production Ready Features - Monitoring and Management overt HTTP" + * section. + */ +package org.springframework.boot.docs.productionreadyfeatures.monitoring.http; diff --git a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/productionreadyfeatures/monitoring/jmx/package-info.java b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/productionreadyfeatures/monitoring/jmx/package-info.java new file mode 100644 index 0000000000..4f30dd6082 --- /dev/null +++ b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/productionreadyfeatures/monitoring/jmx/package-info.java @@ -0,0 +1,21 @@ +/* + * 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. + */ + +/** + * Examples for the "Production Ready Features - Monitoring and Management overt JMX" + * section. + */ +package org.springframework.boot.docs.productionreadyfeatures.monitoring.jmx; diff --git a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/productionreadyfeatures/processmonitoring/package-info.java b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/productionreadyfeatures/processmonitoring/package-info.java new file mode 100644 index 0000000000..d785b52657 --- /dev/null +++ b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/productionreadyfeatures/processmonitoring/package-info.java @@ -0,0 +1,20 @@ +/* + * 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. + */ + +/** + * Examples for the "Production Ready Features - Process Monitoring" section. + */ +package org.springframework.boot.docs.productionreadyfeatures.processmonitoring; diff --git a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/springbootfeatures/caching/package-info.java b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/springbootfeatures/caching/package-info.java new file mode 100644 index 0000000000..ddc23dfa4e --- /dev/null +++ b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/springbootfeatures/caching/package-info.java @@ -0,0 +1,20 @@ +/* + * 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. + */ + +/** + * Examples for the "Spring Boot Features - Caching" section. + */ +package org.springframework.boot.docs.springbootfeatures.caching; diff --git a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/springbootfeatures/containerimages/package-info.java b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/springbootfeatures/containerimages/package-info.java new file mode 100644 index 0000000000..9f29fcca70 --- /dev/null +++ b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/springbootfeatures/containerimages/package-info.java @@ -0,0 +1,20 @@ +/* + * 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. + */ + +/** + * Examples for the "Spring Boot Features - Container Images" section. + */ +package org.springframework.boot.docs.springbootfeatures.containerimages; diff --git a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/autoconfigure/UserService.java b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/springbootfeatures/creatingautoconfiguration/UserService.java similarity index 85% rename from spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/autoconfigure/UserService.java rename to spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/springbootfeatures/creatingautoconfiguration/UserService.java index 4b089ca29b..028fe37b5f 100644 --- a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/autoconfigure/UserService.java +++ b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/springbootfeatures/creatingautoconfiguration/UserService.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * 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. @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.docs.autoconfigure; +package org.springframework.boot.docs.springbootfeatures.creatingautoconfiguration; /** * Sample service. diff --git a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/autoconfigure/UserServiceAutoConfiguration.java b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/springbootfeatures/creatingautoconfiguration/UserServiceAutoConfiguration.java similarity index 85% rename from spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/autoconfigure/UserServiceAutoConfiguration.java rename to spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/springbootfeatures/creatingautoconfiguration/UserServiceAutoConfiguration.java index 7566b78ad5..6b902d778b 100644 --- a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/autoconfigure/UserServiceAutoConfiguration.java +++ b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/springbootfeatures/creatingautoconfiguration/UserServiceAutoConfiguration.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * 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. @@ -14,13 +14,13 @@ * limitations under the License. */ -package org.springframework.boot.docs.autoconfigure; +package org.springframework.boot.docs.springbootfeatures.creatingautoconfiguration; 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.autoconfigure.UserServiceAutoConfiguration.UserProperties; +import org.springframework.boot.docs.springbootfeatures.creatingautoconfiguration.UserServiceAutoConfiguration.UserProperties; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; diff --git a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/springbootfeatures/creatingautoconfiguration/package-info.java b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/springbootfeatures/creatingautoconfiguration/package-info.java new file mode 100644 index 0000000000..07eacefd46 --- /dev/null +++ b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/springbootfeatures/creatingautoconfiguration/package-info.java @@ -0,0 +1,20 @@ +/* + * 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. + */ + +/** + * Examples for the "Spring Boot Features - Creating Your Own Auto-Configuration" section. + */ +package org.springframework.boot.docs.springbootfeatures.creatingautoconfiguration; diff --git a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/springbootfeatures/email/package-info.java b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/springbootfeatures/email/package-info.java new file mode 100644 index 0000000000..b6bca4cd16 --- /dev/null +++ b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/springbootfeatures/email/package-info.java @@ -0,0 +1,20 @@ +/* + * 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. + */ + +/** + * Examples for the "Spring Boot Features - Sending Email" section. + */ +package org.springframework.boot.docs.springbootfeatures.email; diff --git a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/context/properties/bind/constructor/AppIoProperties.java b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/springbootfeatures/externalizedconfiguration/datasize/constructorbinding/AppIoProperties.java similarity index 89% rename from spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/context/properties/bind/constructor/AppIoProperties.java rename to spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/springbootfeatures/externalizedconfiguration/datasize/constructorbinding/AppIoProperties.java index 86bcb9e76a..b94754e06a 100644 --- a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/context/properties/bind/constructor/AppIoProperties.java +++ b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/springbootfeatures/externalizedconfiguration/datasize/constructorbinding/AppIoProperties.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2020 the original author or authors. + * 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. @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.docs.context.properties.bind.constructor; +package org.springframework.boot.docs.springbootfeatures.externalizedconfiguration.datasize.constructorbinding; import org.springframework.boot.context.properties.ConfigurationProperties; import org.springframework.boot.context.properties.ConstructorBinding; @@ -29,7 +29,7 @@ import org.springframework.util.unit.DataUnit; * * @author Stephane Nicoll */ -// tag::example[] +// tag::code[] @ConfigurationProperties("app.io") @ConstructorBinding public class AppIoProperties { @@ -53,4 +53,4 @@ public class AppIoProperties { } } -// end::example[] +// end::code[] diff --git a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/context/properties/bind/javabean/AppIoProperties.java b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/springbootfeatures/externalizedconfiguration/datasize/javabeanbinding/AppIoProperties.java similarity index 88% rename from spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/context/properties/bind/javabean/AppIoProperties.java rename to spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/springbootfeatures/externalizedconfiguration/datasize/javabeanbinding/AppIoProperties.java index 15862ff55f..7aba686820 100644 --- a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/context/properties/bind/javabean/AppIoProperties.java +++ b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/springbootfeatures/externalizedconfiguration/datasize/javabeanbinding/AppIoProperties.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2020 the original author or authors. + * 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. @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.docs.context.properties.bind.javabean; +package org.springframework.boot.docs.springbootfeatures.externalizedconfiguration.datasize.javabeanbinding; import org.springframework.boot.context.properties.ConfigurationProperties; import org.springframework.boot.convert.DataSizeUnit; @@ -27,7 +27,7 @@ import org.springframework.util.unit.DataUnit; * * @author Stephane Nicoll */ -// tag::example[] +// tag::code[] @ConfigurationProperties("app.io") public class AppIoProperties { @@ -53,4 +53,4 @@ public class AppIoProperties { } } -// end::example[] +// end::code[] diff --git a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/context/properties/bind/constructor/AppSystemProperties.java b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/springbootfeatures/externalizedconfiguration/duration/constructorbinding/AppSystemProperties.java similarity index 89% rename from spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/context/properties/bind/constructor/AppSystemProperties.java rename to spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/springbootfeatures/externalizedconfiguration/duration/constructorbinding/AppSystemProperties.java index d30b635c83..58089d7bb6 100644 --- a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/context/properties/bind/constructor/AppSystemProperties.java +++ b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/springbootfeatures/externalizedconfiguration/duration/constructorbinding/AppSystemProperties.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2020 the original author or authors. + * 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. @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.docs.context.properties.bind.constructor; +package org.springframework.boot.docs.springbootfeatures.externalizedconfiguration.duration.constructorbinding; import java.time.Duration; import java.time.temporal.ChronoUnit; @@ -30,7 +30,7 @@ import org.springframework.boot.convert.DurationUnit; * * @author Stephane Nicoll */ -// tag::example[] +// tag::code[] @ConfigurationProperties("app.system") @ConstructorBinding public class AppSystemProperties { @@ -54,4 +54,4 @@ public class AppSystemProperties { } } -// end::example[] +// end::code[] diff --git a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/context/properties/bind/javabean/AppSystemProperties.java b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/springbootfeatures/externalizedconfiguration/duration/javabeanbinding/AppSystemProperties.java similarity index 88% rename from spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/context/properties/bind/javabean/AppSystemProperties.java rename to spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/springbootfeatures/externalizedconfiguration/duration/javabeanbinding/AppSystemProperties.java index eca2bb4407..5ee4ef56ce 100644 --- a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/context/properties/bind/javabean/AppSystemProperties.java +++ b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/springbootfeatures/externalizedconfiguration/duration/javabeanbinding/AppSystemProperties.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2020 the original author or authors. + * 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. @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.docs.context.properties.bind.javabean; +package org.springframework.boot.docs.springbootfeatures.externalizedconfiguration.duration.javabeanbinding; import java.time.Duration; import java.time.temporal.ChronoUnit; @@ -28,7 +28,7 @@ import org.springframework.boot.convert.DurationUnit; * * @author Stephane Nicoll */ -// tag::example[] +// tag::code[] @ConfigurationProperties("app.system") public class AppSystemProperties { @@ -54,4 +54,4 @@ public class AppSystemProperties { } } -// end::example[] +// end::code[] diff --git a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/springbootfeatures/externalizedconfiguration/package-info.java b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/springbootfeatures/externalizedconfiguration/package-info.java new file mode 100644 index 0000000000..7a663f72c9 --- /dev/null +++ b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/springbootfeatures/externalizedconfiguration/package-info.java @@ -0,0 +1,20 @@ +/* + * 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. + */ + +/** + * Examples for the "Spring Boot Features - Externalized Configuration" section. + */ +package org.springframework.boot.docs.springbootfeatures.externalizedconfiguration; diff --git a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/springbootfeatures/gracefulshutdown/package-info.java b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/springbootfeatures/gracefulshutdown/package-info.java new file mode 100644 index 0000000000..6d9a551294 --- /dev/null +++ b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/springbootfeatures/gracefulshutdown/package-info.java @@ -0,0 +1,20 @@ +/* + * 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. + */ + +/** + * Examples for the "Spring Boot Features - Graceful Shutdown" section. + */ +package org.springframework.boot.docs.springbootfeatures.gracefulshutdown; diff --git a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/springbootfeatures/hazelcast/package-info.java b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/springbootfeatures/hazelcast/package-info.java new file mode 100644 index 0000000000..a3b310c68b --- /dev/null +++ b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/springbootfeatures/hazelcast/package-info.java @@ -0,0 +1,20 @@ +/* + * 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. + */ + +/** + * Examples for the "Spring Boot Features - Hazelcast" section. + */ +package org.springframework.boot.docs.springbootfeatures.hazelcast; diff --git a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/springbootfeatures/integration/package-info.java b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/springbootfeatures/integration/package-info.java new file mode 100644 index 0000000000..24ed40f48c --- /dev/null +++ b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/springbootfeatures/integration/package-info.java @@ -0,0 +1,20 @@ +/* + * 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. + */ + +/** + * Examples for the "Spring Boot Features - Spring Integration" section. + */ +package org.springframework.boot.docs.springbootfeatures.integration; diff --git a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/springbootfeatures/internationalization/package-info.java b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/springbootfeatures/internationalization/package-info.java new file mode 100644 index 0000000000..24086edc3b --- /dev/null +++ b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/springbootfeatures/internationalization/package-info.java @@ -0,0 +1,20 @@ +/* + * 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. + */ + +/** + * Examples for the "Spring Boot Features - Internationalization" section. + */ +package org.springframework.boot.docs.springbootfeatures.internationalization; diff --git a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/springbootfeatures/json/package-info.java b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/springbootfeatures/json/package-info.java new file mode 100644 index 0000000000..6ed366df90 --- /dev/null +++ b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/springbootfeatures/json/package-info.java @@ -0,0 +1,20 @@ +/* + * 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. + */ + +/** + * Examples for the "Spring Boot Features - JSON" section. + */ +package org.springframework.boot.docs.springbootfeatures.json; diff --git a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/springbootfeatures/jta/package-info.java b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/springbootfeatures/jta/package-info.java new file mode 100644 index 0000000000..ccd9881872 --- /dev/null +++ b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/springbootfeatures/jta/package-info.java @@ -0,0 +1,20 @@ +/* + * 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. + */ + +/** + * Examples for the "Spring Boot Features - Distributed Transactions with JTA" section. + */ +package org.springframework.boot.docs.springbootfeatures.jta; diff --git a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/springbootfeatures/kotlin/package-info.java b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/springbootfeatures/kotlin/package-info.java new file mode 100644 index 0000000000..ff3d203b9d --- /dev/null +++ b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/springbootfeatures/kotlin/package-info.java @@ -0,0 +1,20 @@ +/* + * 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. + */ + +/** + * Examples for the "Spring Boot Features - Kotlin" section. + */ +package org.springframework.boot.docs.springbootfeatures.kotlin; diff --git a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/springbootfeatures/logging/package-info.java b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/springbootfeatures/logging/package-info.java new file mode 100644 index 0000000000..e8ea52187d --- /dev/null +++ b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/springbootfeatures/logging/package-info.java @@ -0,0 +1,20 @@ +/* + * 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. + */ + +/** + * Examples for the "Spring Boot Features - Logging" section. + */ +package org.springframework.boot.docs.springbootfeatures.logging; diff --git a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/kafka/KafkaStreamsBeanExample.java b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/springbootfeatures/messaging/KafkaStreamsBeanExample.java similarity index 91% rename from spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/kafka/KafkaStreamsBeanExample.java rename to spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/springbootfeatures/messaging/KafkaStreamsBeanExample.java index ebad610feb..7575be40f3 100644 --- a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/kafka/KafkaStreamsBeanExample.java +++ b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/springbootfeatures/messaging/KafkaStreamsBeanExample.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * 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. @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.docs.kafka; +package org.springframework.boot.docs.springbootfeatures.messaging; import org.apache.kafka.common.serialization.Serdes; import org.apache.kafka.streams.KeyValue; @@ -34,7 +34,7 @@ import org.springframework.kafka.support.serializer.JsonSerde; */ public class KafkaStreamsBeanExample { - // tag::configuration[] + // tag::code[] @Configuration(proxyBeanMethods = false) @EnableKafkaStreams public static class KafkaStreamsExampleConfiguration { @@ -48,6 +48,6 @@ public class KafkaStreamsBeanExample { } } - // end::configuration[] + // end::code[] } diff --git a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/springbootfeatures/messaging/package-info.java b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/springbootfeatures/messaging/package-info.java new file mode 100644 index 0000000000..e90952c474 --- /dev/null +++ b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/springbootfeatures/messaging/package-info.java @@ -0,0 +1,20 @@ +/* + * 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. + */ + +/** + * Examples for the "Spring Boot Features - Messaging" section. + */ +package org.springframework.boot.docs.springbootfeatures.messaging; diff --git a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/springbootfeatures/monitoring/jmx/package-info.java b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/springbootfeatures/monitoring/jmx/package-info.java new file mode 100644 index 0000000000..9f29cd5082 --- /dev/null +++ b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/springbootfeatures/monitoring/jmx/package-info.java @@ -0,0 +1,20 @@ +/* + * 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. + */ + +/** + * Examples for the "Spring Boot Features - Monitoring with JMX" section. + */ +package org.springframework.boot.docs.springbootfeatures.monitoring.jmx; diff --git a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/cache/CouchbaseCacheManagerCustomizationExample.java b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/springbootfeatures/nosql/CouchbaseCacheManagerCustomizationExample.java similarity index 91% rename from spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/cache/CouchbaseCacheManagerCustomizationExample.java rename to spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/springbootfeatures/nosql/CouchbaseCacheManagerCustomizationExample.java index 612a955c2c..987c877946 100644 --- a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/cache/CouchbaseCacheManagerCustomizationExample.java +++ b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/springbootfeatures/nosql/CouchbaseCacheManagerCustomizationExample.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2020 the original author or authors. + * 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. @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.docs.cache; +package org.springframework.boot.docs.springbootfeatures.nosql; import java.time.Duration; @@ -32,7 +32,7 @@ import org.springframework.data.couchbase.cache.CouchbaseCacheConfiguration; @Configuration(proxyBeanMethods = false) public class CouchbaseCacheManagerCustomizationExample { - // tag::configuration[] + // tag::code[] @Bean public CouchbaseCacheManagerBuilderCustomizer myCouchbaseCacheManagerBuilderCustomizer() { return (builder) -> builder @@ -42,6 +42,6 @@ public class CouchbaseCacheManagerCustomizationExample { CouchbaseCacheConfiguration.defaultCacheConfig().entryExpiry(Duration.ofMinutes(1))); } - // end::configuration[] + // end::code[] } diff --git a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/neo4j/Neo4jReactiveTransactionManagerExample.java b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/springbootfeatures/nosql/Neo4jReactiveTransactionManagerExample.java similarity index 90% rename from spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/neo4j/Neo4jReactiveTransactionManagerExample.java rename to spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/springbootfeatures/nosql/Neo4jReactiveTransactionManagerExample.java index 81a95ce5d6..24398a43f0 100644 --- a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/neo4j/Neo4jReactiveTransactionManagerExample.java +++ b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/springbootfeatures/nosql/Neo4jReactiveTransactionManagerExample.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2020 the original author or authors. + * 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. @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.docs.neo4j; +package org.springframework.boot.docs.springbootfeatures.nosql; import org.neo4j.driver.Driver; @@ -32,12 +32,12 @@ import org.springframework.transaction.ReactiveTransactionManager; @Configuration(proxyBeanMethods = false) public class Neo4jReactiveTransactionManagerExample { - // tag::configuration[] + // tag::code[] @Bean public ReactiveNeo4jTransactionManager reactiveTransactionManager(Driver driver, ReactiveDatabaseSelectionProvider databaseNameProvider) { return new ReactiveNeo4jTransactionManager(driver, databaseNameProvider); } - // end::configuration[] + // end::code[] } diff --git a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/cache/RedisCacheManagerCustomizationExample.java b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/springbootfeatures/nosql/RedisCacheManagerCustomizationExample.java similarity index 90% rename from spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/cache/RedisCacheManagerCustomizationExample.java rename to spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/springbootfeatures/nosql/RedisCacheManagerCustomizationExample.java index 88f56fa93d..fef562a29d 100644 --- a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/cache/RedisCacheManagerCustomizationExample.java +++ b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/springbootfeatures/nosql/RedisCacheManagerCustomizationExample.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2020 the original author or authors. + * 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. @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.docs.cache; +package org.springframework.boot.docs.springbootfeatures.nosql; import java.time.Duration; @@ -32,7 +32,7 @@ import org.springframework.data.redis.cache.RedisCacheConfiguration; @Configuration(proxyBeanMethods = false) public class RedisCacheManagerCustomizationExample { - // tag::configuration[] + // tag::code[] @Bean public RedisCacheManagerBuilderCustomizer myRedisCacheManagerBuilderCustomizer() { return (builder) -> builder @@ -42,6 +42,6 @@ public class RedisCacheManagerCustomizationExample { RedisCacheConfiguration.defaultCacheConfig().entryTtl(Duration.ofMinutes(1))); } - // end::configuration[] + // end::code[] } diff --git a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/springbootfeatures/nosql/package-info.java b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/springbootfeatures/nosql/package-info.java new file mode 100644 index 0000000000..3602d39519 --- /dev/null +++ b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/springbootfeatures/nosql/package-info.java @@ -0,0 +1,20 @@ +/* + * 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. + */ + +/** + * Examples for the "Spring Boot Features - Working with NoSQL Technologies" section. + */ +package org.springframework.boot.docs.springbootfeatures.nosql; diff --git a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/springbootfeatures/profiles/package-info.java b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/springbootfeatures/profiles/package-info.java new file mode 100644 index 0000000000..9f29878c13 --- /dev/null +++ b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/springbootfeatures/profiles/package-info.java @@ -0,0 +1,20 @@ +/* + * 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. + */ + +/** + * Examples for the "Spring Boot Features - Profiles" section. + */ +package org.springframework.boot.docs.springbootfeatures.profiles; diff --git a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/springbootfeatures/quartz/package-info.java b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/springbootfeatures/quartz/package-info.java new file mode 100644 index 0000000000..201bb165a3 --- /dev/null +++ b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/springbootfeatures/quartz/package-info.java @@ -0,0 +1,20 @@ +/* + * 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. + */ + +/** + * Examples for the "Spring Boot Features - Quartz" section. + */ +package org.springframework.boot.docs.springbootfeatures.quartz; diff --git a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/web/client/RestTemplateBuilderCustomizationExample.java b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/springbootfeatures/resttemplate/RestTemplateBuilderCustomizationExample.java similarity index 89% rename from spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/web/client/RestTemplateBuilderCustomizationExample.java rename to spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/springbootfeatures/resttemplate/RestTemplateBuilderCustomizationExample.java index d67e4328a6..41f641abee 100644 --- a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/web/client/RestTemplateBuilderCustomizationExample.java +++ b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/springbootfeatures/resttemplate/RestTemplateBuilderCustomizationExample.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2020 the original author or authors. + * 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. @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.docs.web.client; +package org.springframework.boot.docs.springbootfeatures.resttemplate; import java.time.Duration; @@ -32,12 +32,12 @@ import org.springframework.context.annotation.Configuration; @Configuration(proxyBeanMethods = false) public class RestTemplateBuilderCustomizationExample { - // tag::customizer[] + // tag::code[] @Bean public RestTemplateBuilder restTemplateBuilder(RestTemplateBuilderConfigurer configurer) { return configurer.configure(new RestTemplateBuilder()).setConnectTimeout(Duration.ofSeconds(5)) .setReadTimeout(Duration.ofSeconds(2)); } - // end::customizer[] + // end::code[] } diff --git a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/web/client/RestTemplateProxyCustomizationExample.java b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/springbootfeatures/resttemplate/RestTemplateProxyCustomizationExample.java similarity index 92% rename from spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/web/client/RestTemplateProxyCustomizationExample.java rename to spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/springbootfeatures/resttemplate/RestTemplateProxyCustomizationExample.java index ae9a13c66f..4fb1170fd2 100644 --- a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/web/client/RestTemplateProxyCustomizationExample.java +++ b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/springbootfeatures/resttemplate/RestTemplateProxyCustomizationExample.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * 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. @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.docs.web.client; +package org.springframework.boot.docs.springbootfeatures.resttemplate; import org.apache.http.HttpException; import org.apache.http.HttpHost; @@ -39,7 +39,7 @@ public class RestTemplateProxyCustomizationExample { * A {@link RestTemplateCustomizer} that applies an HttpComponents-based request * factory that is configured to use a proxy. */ - // tag::customizer[] + // tag::code[] static class ProxyCustomizer implements RestTemplateCustomizer { @Override @@ -61,6 +61,6 @@ public class RestTemplateProxyCustomizationExample { } } - // end::customizer[] + // end::code[] } diff --git a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/springbootfeatures/resttemplate/package-info.java b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/springbootfeatures/resttemplate/package-info.java new file mode 100644 index 0000000000..7fd33321fc --- /dev/null +++ b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/springbootfeatures/resttemplate/package-info.java @@ -0,0 +1,21 @@ +/* + * 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. + */ + +/** + * Examples for the "Spring Boot Features - Calling REST Services with RestTemplate" + * section. + */ +package org.springframework.boot.docs.springbootfeatures.resttemplate; diff --git a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/springbootfeatures/rsocket/package-info.java b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/springbootfeatures/rsocket/package-info.java new file mode 100644 index 0000000000..abb6394716 --- /dev/null +++ b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/springbootfeatures/rsocket/package-info.java @@ -0,0 +1,20 @@ +/* + * 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. + */ + +/** + * Examples for the "Spring Boot Features - RSocket" section. + */ +package org.springframework.boot.docs.springbootfeatures.rsocket; diff --git a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/web/security/CustomWebFluxSecurityExample.java b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/springbootfeatures/security/CustomWebFluxSecurityExample.java similarity index 90% rename from spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/web/security/CustomWebFluxSecurityExample.java rename to spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/springbootfeatures/security/CustomWebFluxSecurityExample.java index 9db671e57e..e82d72250a 100644 --- a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/web/security/CustomWebFluxSecurityExample.java +++ b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/springbootfeatures/security/CustomWebFluxSecurityExample.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * 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. @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.docs.web.security; +package org.springframework.boot.docs.springbootfeatures.security; import org.springframework.boot.autoconfigure.security.reactive.PathRequest; import org.springframework.context.annotation.Bean; @@ -31,7 +31,7 @@ import org.springframework.security.web.server.SecurityWebFilterChain; public class CustomWebFluxSecurityExample { // @formatter:off - // tag::configuration[] + // tag::code[] @Bean public SecurityWebFilterChain springSecurityFilterChain(ServerHttpSecurity http) { return http @@ -42,7 +42,7 @@ public class CustomWebFluxSecurityExample { .formLogin().and() .build(); } - // end::configuration[] + // end::code[] // @formatter:on } diff --git a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/springbootfeatures/security/package-info.java b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/springbootfeatures/security/package-info.java new file mode 100644 index 0000000000..b2aa6cd5e0 --- /dev/null +++ b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/springbootfeatures/security/package-info.java @@ -0,0 +1,20 @@ +/* + * 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. + */ + +/** + * Examples for the "Spring Boot Features - Security" section. + */ +package org.springframework.boot.docs.springbootfeatures.security; diff --git a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/springbootfeatures/session/package-info.java b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/springbootfeatures/session/package-info.java new file mode 100644 index 0000000000..e0b0be9834 --- /dev/null +++ b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/springbootfeatures/session/package-info.java @@ -0,0 +1,20 @@ +/* + * 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. + */ + +/** + * Examples for the "Spring Boot Features - Spring Session" section. + */ +package org.springframework.boot.docs.springbootfeatures.session; diff --git a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/ExitCodeApplication.java b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/springbootfeatures/springapplication/ExitCodeExample.java similarity index 83% rename from spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/ExitCodeApplication.java rename to spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/springbootfeatures/springapplication/ExitCodeExample.java index 813c6ed092..43c81fd2ec 100644 --- a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/ExitCodeApplication.java +++ b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/springbootfeatures/springapplication/ExitCodeExample.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * 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. @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.docs; +package org.springframework.boot.docs.springbootfeatures.springapplication; import org.springframework.boot.ExitCodeGenerator; import org.springframework.boot.SpringApplication; @@ -26,9 +26,9 @@ import org.springframework.context.annotation.Bean; * * @author Stephane Nicoll */ -// tag::example[] +// tag::code[] @SpringBootApplication -public class ExitCodeApplication { +public class ExitCodeExample { @Bean public ExitCodeGenerator exitCodeGenerator() { @@ -36,8 +36,8 @@ public class ExitCodeApplication { } public static void main(String[] args) { - System.exit(SpringApplication.exit(SpringApplication.run(ExitCodeApplication.class, args))); + System.exit(SpringApplication.exit(SpringApplication.run(ExitCodeExample.class, args))); } } -// end::example[] +// end::code[] diff --git a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/builder/SpringApplicationBuilderExample.java b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/springbootfeatures/springapplication/SpringApplicationBuilderExample.java similarity index 87% rename from spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/builder/SpringApplicationBuilderExample.java rename to spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/springbootfeatures/springapplication/SpringApplicationBuilderExample.java index d1944fff70..9d2225a996 100644 --- a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/builder/SpringApplicationBuilderExample.java +++ b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/springbootfeatures/springapplication/SpringApplicationBuilderExample.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * 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. @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.docs.builder; +package org.springframework.boot.docs.springbootfeatures.springapplication; import org.springframework.boot.Banner; import org.springframework.boot.builder.SpringApplicationBuilder; @@ -28,13 +28,13 @@ public class SpringApplicationBuilderExample { public void hierarchyWithDisabledBanner(String[] args) { // @formatter:off - // tag::hierarchy[] + // tag::code[] new SpringApplicationBuilder() .sources(Parent.class) .child(Application.class) .bannerMode(Banner.Mode.OFF) .run(args); - // end::hierarchy[] + // end::code[] // @formatter:on } diff --git a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/springbootfeatures/springapplication/package-info.java b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/springbootfeatures/springapplication/package-info.java new file mode 100644 index 0000000000..2af4c750ba --- /dev/null +++ b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/springbootfeatures/springapplication/package-info.java @@ -0,0 +1,20 @@ +/* + * 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. + */ + +/** + * Examples for the "Spring Boot Features - SpringApplication" section. + */ +package org.springframework.boot.docs.springbootfeatures.springapplication; diff --git a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/springbootfeatures/sql/package-info.java b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/springbootfeatures/sql/package-info.java new file mode 100644 index 0000000000..9aad26329e --- /dev/null +++ b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/springbootfeatures/sql/package-info.java @@ -0,0 +1,20 @@ +/* + * 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. + */ + +/** + * Examples for the "Spring Boot Features - Working with SQL Databases" section. + */ +package org.springframework.boot.docs.springbootfeatures.sql; diff --git a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/springbootfeatures/task/package-info.java b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/springbootfeatures/task/package-info.java new file mode 100644 index 0000000000..ee9d796674 --- /dev/null +++ b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/springbootfeatures/task/package-info.java @@ -0,0 +1,20 @@ +/* + * 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. + */ + +/** + * Examples for the "Spring Boot Features - Task Execution and Scheduling" section. + */ +package org.springframework.boot.docs.springbootfeatures.task; diff --git a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/test/context/ApplicationArgumentsExampleTests.java b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/springbootfeatures/testing/ApplicationArgumentsExampleTests.java similarity index 88% rename from spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/test/context/ApplicationArgumentsExampleTests.java rename to spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/springbootfeatures/testing/ApplicationArgumentsExampleTests.java index 7962581716..5e309044c8 100644 --- a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/test/context/ApplicationArgumentsExampleTests.java +++ b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/springbootfeatures/testing/ApplicationArgumentsExampleTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * 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. @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.docs.test.context; +package org.springframework.boot.docs.springbootfeatures.testing; import org.junit.jupiter.api.Test; @@ -24,7 +24,7 @@ import org.springframework.boot.test.context.SpringBootTest; import static org.assertj.core.api.Assertions.assertThat; -// tag::example[] +// tag::code[] @SpringBootTest(args = "--app.test=one") class ApplicationArgumentsExampleTests { @@ -35,4 +35,4 @@ class ApplicationArgumentsExampleTests { } } -// end::example[] +// end::code[] diff --git a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/test/web/MockMvcExampleTests.java b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/springbootfeatures/testing/MockMvcExampleTests.java similarity index 90% rename from spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/test/web/MockMvcExampleTests.java rename to spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/springbootfeatures/testing/MockMvcExampleTests.java index e6e6738363..a660a8d3d1 100644 --- a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/test/web/MockMvcExampleTests.java +++ b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/springbootfeatures/testing/MockMvcExampleTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * 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. @@ -14,9 +14,9 @@ * limitations under the License. */ -package org.springframework.boot.docs.test.web; +package org.springframework.boot.docs.springbootfeatures.testing; -// tag::test-mock-mvc[] +// tag::code[] import org.junit.jupiter.api.Test; @@ -39,4 +39,4 @@ class MockMvcExampleTests { } } -// end::test-mock-mvc[] +// end::code[] diff --git a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/test/web/MockWebTestClientExampleTests.java b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/springbootfeatures/testing/MockWebTestClientExampleTests.java similarity index 86% rename from spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/test/web/MockWebTestClientExampleTests.java rename to spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/springbootfeatures/testing/MockWebTestClientExampleTests.java index 883f5ebd38..f747b1b144 100644 --- a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/test/web/MockWebTestClientExampleTests.java +++ b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/springbootfeatures/testing/MockWebTestClientExampleTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * 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. @@ -14,9 +14,9 @@ * limitations under the License. */ -package org.springframework.boot.docs.test.web; +package org.springframework.boot.docs.springbootfeatures.testing; -// tag::test-mock-web-test-client[] +// tag::code[] import org.junit.jupiter.api.Test; @@ -35,4 +35,4 @@ class MockWebTestClientExampleTests { } } -// end::test-mock-web-test-client[] +// end::code[] diff --git a/spring-boot-project/spring-boot-docs/src/test/java/org/springframework/boot/docs/test/system/OutputCaptureTests.java b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/springbootfeatures/testing/OutputCaptureTests.java similarity index 88% rename from spring-boot-project/spring-boot-docs/src/test/java/org/springframework/boot/docs/test/system/OutputCaptureTests.java rename to spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/springbootfeatures/testing/OutputCaptureTests.java index 8f9a3731fc..8be3578e25 100644 --- a/spring-boot-project/spring-boot-docs/src/test/java/org/springframework/boot/docs/test/system/OutputCaptureTests.java +++ b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/springbootfeatures/testing/OutputCaptureTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * 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. @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.docs.test.system; +package org.springframework.boot.docs.springbootfeatures.testing; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; @@ -29,7 +29,7 @@ import static org.assertj.core.api.Assertions.assertThat; * * @author Stephane Nicoll */ -// tag::test[] +// tag::code[] @ExtendWith(OutputCaptureExtension.class) class OutputCaptureTests { @@ -40,4 +40,4 @@ class OutputCaptureTests { } } -// end::test[] +// end::code[] diff --git a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/test/web/RandomPortTestRestTemplateExampleTests.java b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/springbootfeatures/testing/RandomPortTestRestTemplateExampleTests.java similarity index 88% rename from spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/test/web/RandomPortTestRestTemplateExampleTests.java rename to spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/springbootfeatures/testing/RandomPortTestRestTemplateExampleTests.java index 32a93ad3d1..4eec421c87 100644 --- a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/test/web/RandomPortTestRestTemplateExampleTests.java +++ b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/springbootfeatures/testing/RandomPortTestRestTemplateExampleTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * 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. @@ -14,9 +14,9 @@ * limitations under the License. */ -package org.springframework.boot.docs.test.web; +package org.springframework.boot.docs.springbootfeatures.testing; -// tag::test-random-port[] +// tag::code[] import org.junit.jupiter.api.Test; @@ -37,4 +37,4 @@ class RandomPortTestRestTemplateExampleTests { } } -// end::test-random-port[] +// end::code[] diff --git a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/test/web/RandomPortWebTestClientExampleTests.java b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/springbootfeatures/testing/RandomPortWebTestClientExampleTests.java similarity index 88% rename from spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/test/web/RandomPortWebTestClientExampleTests.java rename to spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/springbootfeatures/testing/RandomPortWebTestClientExampleTests.java index 9a800a3f3e..7274832489 100644 --- a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/test/web/RandomPortWebTestClientExampleTests.java +++ b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/springbootfeatures/testing/RandomPortWebTestClientExampleTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * 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. @@ -14,9 +14,9 @@ * limitations under the License. */ -package org.springframework.boot.docs.test.web; +package org.springframework.boot.docs.springbootfeatures.testing; -// tag::test-random-port[] +// tag::code[] import org.junit.jupiter.api.Test; @@ -34,4 +34,4 @@ class RandomPortWebTestClientExampleTests { } } -// end::test-random-port[] +// end::code[] diff --git a/spring-boot-project/spring-boot-docs/src/test/java/org/springframework/boot/docs/autoconfigure/UserServiceAutoConfigurationTests.java b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/springbootfeatures/testing/UserServiceAutoConfigurationTests.java similarity index 88% rename from spring-boot-project/spring-boot-docs/src/test/java/org/springframework/boot/docs/autoconfigure/UserServiceAutoConfigurationTests.java rename to spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/springbootfeatures/testing/UserServiceAutoConfigurationTests.java index ddff07b9cf..1ab6c8903a 100644 --- a/spring-boot-project/spring-boot-docs/src/test/java/org/springframework/boot/docs/autoconfigure/UserServiceAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/springbootfeatures/testing/UserServiceAutoConfigurationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * 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. @@ -14,11 +14,13 @@ * limitations under the License. */ -package org.springframework.boot.docs.autoconfigure; +package org.springframework.boot.docs.springbootfeatures.testing; import org.junit.jupiter.api.Test; import org.springframework.boot.autoconfigure.AutoConfigurations; +import org.springframework.boot.docs.springbootfeatures.creatingautoconfiguration.UserService; +import org.springframework.boot.docs.springbootfeatures.creatingautoconfiguration.UserServiceAutoConfiguration; import org.springframework.boot.test.context.FilteredClassLoader; import org.springframework.boot.test.context.runner.ApplicationContextRunner; import org.springframework.context.annotation.Bean; diff --git a/spring-boot-project/spring-boot-docs/src/test/java/org/springframework/boot/docs/jmx/SampleApp.java b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/springbootfeatures/testing/jmx/SampleApp.java similarity index 89% rename from spring-boot-project/spring-boot-docs/src/test/java/org/springframework/boot/docs/jmx/SampleApp.java rename to spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/springbootfeatures/testing/jmx/SampleApp.java index ea5ecad61f..71efc7caab 100644 --- a/spring-boot-project/spring-boot-docs/src/test/java/org/springframework/boot/docs/jmx/SampleApp.java +++ b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/springbootfeatures/testing/jmx/SampleApp.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * 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. @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.docs.jmx; +package org.springframework.boot.docs.springbootfeatures.testing.jmx; import org.springframework.boot.SpringBootConfiguration; import org.springframework.boot.autoconfigure.ImportAutoConfiguration; diff --git a/spring-boot-project/spring-boot-docs/src/test/java/org/springframework/boot/docs/jmx/SampleJmxTests.java b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/springbootfeatures/testing/jmx/SampleJmxTests.java similarity index 89% rename from spring-boot-project/spring-boot-docs/src/test/java/org/springframework/boot/docs/jmx/SampleJmxTests.java rename to spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/springbootfeatures/testing/jmx/SampleJmxTests.java index c469e6daa3..eefe5b29a6 100644 --- a/spring-boot-project/spring-boot-docs/src/test/java/org/springframework/boot/docs/jmx/SampleJmxTests.java +++ b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/springbootfeatures/testing/jmx/SampleJmxTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * 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. @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.docs.jmx; +package org.springframework.boot.docs.springbootfeatures.testing.jmx; import javax.management.MBeanServer; @@ -32,7 +32,7 @@ import org.springframework.test.context.junit.jupiter.SpringExtension; * @author Stephane Nicoll */ @SuppressWarnings("unused") -// tag::test[] +// tag::code[] @ExtendWith(SpringExtension.class) @SpringBootTest(properties = "spring.jmx.enabled=true") @DirtiesContext @@ -47,4 +47,4 @@ class SampleJmxTests { } } -// end::test[] +// end::code[] diff --git a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/springbootfeatures/testing/package-info.java b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/springbootfeatures/testing/package-info.java new file mode 100644 index 0000000000..e499e9d77a --- /dev/null +++ b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/springbootfeatures/testing/package-info.java @@ -0,0 +1,20 @@ +/* + * 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. + */ + +/** + * Examples for the "Spring Boot Features - Testing" section. + */ +package org.springframework.boot.docs.springbootfeatures.testing; diff --git a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/test/autoconfigure/restdocs/restassured/AdvancedConfigurationExample.java b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/springbootfeatures/testing/restdocs/restassured/AdvancedConfigurationExample.java similarity index 87% rename from spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/test/autoconfigure/restdocs/restassured/AdvancedConfigurationExample.java rename to spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/springbootfeatures/testing/restdocs/restassured/AdvancedConfigurationExample.java index 1e3247b893..f1ffafff00 100644 --- a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/test/autoconfigure/restdocs/restassured/AdvancedConfigurationExample.java +++ b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/springbootfeatures/testing/restdocs/restassured/AdvancedConfigurationExample.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * 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. @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.docs.test.autoconfigure.restdocs.restassured; +package org.springframework.boot.docs.springbootfeatures.testing.restdocs.restassured; import org.springframework.boot.test.autoconfigure.restdocs.RestDocsRestAssuredConfigurationCustomizer; import org.springframework.boot.test.context.TestConfiguration; @@ -23,7 +23,7 @@ import org.springframework.restdocs.templates.TemplateFormats; public class AdvancedConfigurationExample { - // tag::configuration[] + // tag::code[] @TestConfiguration(proxyBeanMethods = false) public static class CustomizationConfiguration implements RestDocsRestAssuredConfigurationCustomizer { @@ -33,6 +33,6 @@ public class AdvancedConfigurationExample { } } - // end::configuration[] + // end::code[] } diff --git a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/test/autoconfigure/restdocs/restassured/UserDocumentationTests.java b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/springbootfeatures/testing/restdocs/restassured/UserDocumentationTests.java similarity index 89% rename from spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/test/autoconfigure/restdocs/restassured/UserDocumentationTests.java rename to spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/springbootfeatures/testing/restdocs/restassured/UserDocumentationTests.java index 84f2ec1323..b2e48aac4e 100644 --- a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/test/autoconfigure/restdocs/restassured/UserDocumentationTests.java +++ b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/springbootfeatures/testing/restdocs/restassured/UserDocumentationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * 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. @@ -14,9 +14,9 @@ * limitations under the License. */ -package org.springframework.boot.docs.test.autoconfigure.restdocs.restassured; +package org.springframework.boot.docs.springbootfeatures.testing.restdocs.restassured; -// tag::source[] +// tag::code[] import io.restassured.specification.RequestSpecification; import org.junit.jupiter.api.Test; @@ -41,4 +41,4 @@ class UserDocumentationTests { } } -// end::source[] +// end::code[] diff --git a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/test/autoconfigure/restdocs/webclient/AdvancedConfigurationExample.java b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/springbootfeatures/testing/restdocs/webclient/AdvancedConfigurationExample.java similarity index 86% rename from spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/test/autoconfigure/restdocs/webclient/AdvancedConfigurationExample.java rename to spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/springbootfeatures/testing/restdocs/webclient/AdvancedConfigurationExample.java index a5b574a59d..bd38c93b33 100644 --- a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/test/autoconfigure/restdocs/webclient/AdvancedConfigurationExample.java +++ b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/springbootfeatures/testing/restdocs/webclient/AdvancedConfigurationExample.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * 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. @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.docs.test.autoconfigure.restdocs.webclient; +package org.springframework.boot.docs.springbootfeatures.testing.restdocs.webclient; import org.springframework.boot.test.autoconfigure.restdocs.RestDocsWebTestClientConfigurationCustomizer; import org.springframework.boot.test.context.TestConfiguration; @@ -22,7 +22,7 @@ import org.springframework.restdocs.webtestclient.WebTestClientRestDocumentation public class AdvancedConfigurationExample { - // tag::configuration[] + // tag::code[] @TestConfiguration(proxyBeanMethods = false) public static class CustomizationConfiguration implements RestDocsWebTestClientConfigurationCustomizer { @@ -32,6 +32,6 @@ public class AdvancedConfigurationExample { } } - // end::configuration[] + // end::code[] } diff --git a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/test/autoconfigure/restdocs/webclient/UsersDocumentationTests.java b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/springbootfeatures/testing/restdocs/webclient/UsersDocumentationTests.java similarity index 88% rename from spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/test/autoconfigure/restdocs/webclient/UsersDocumentationTests.java rename to spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/springbootfeatures/testing/restdocs/webclient/UsersDocumentationTests.java index 7f06bc090c..f6ebbdb3c6 100644 --- a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/test/autoconfigure/restdocs/webclient/UsersDocumentationTests.java +++ b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/springbootfeatures/testing/restdocs/webclient/UsersDocumentationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * 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. @@ -14,9 +14,9 @@ * limitations under the License. */ -package org.springframework.boot.docs.test.autoconfigure.restdocs.webclient; +package org.springframework.boot.docs.springbootfeatures.testing.restdocs.webclient; -// tag::source[] +// tag::code[] import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; @@ -40,4 +40,4 @@ class UsersDocumentationTests { } } -// end::source[] +// end::code[] diff --git a/spring-boot-project/spring-boot-docs/src/test/java/org/springframework/boot/docs/web/client/SampleWebClientConfiguration.java b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/springbootfeatures/testing/webclient/SampleWebClientConfiguration.java similarity index 93% rename from spring-boot-project/spring-boot-docs/src/test/java/org/springframework/boot/docs/web/client/SampleWebClientConfiguration.java rename to spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/springbootfeatures/testing/webclient/SampleWebClientConfiguration.java index f96e46538b..f242cb2a76 100644 --- a/spring-boot-project/spring-boot-docs/src/test/java/org/springframework/boot/docs/web/client/SampleWebClientConfiguration.java +++ b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/springbootfeatures/testing/webclient/SampleWebClientConfiguration.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * 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. @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.docs.web.client; +package org.springframework.boot.docs.springbootfeatures.testing.webclient; import java.net.URI; diff --git a/spring-boot-project/spring-boot-docs/src/test/java/org/springframework/boot/docs/web/client/SampleWebClientTests.java b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/springbootfeatures/testing/webclient/SampleWebClientTests.java similarity index 92% rename from spring-boot-project/spring-boot-docs/src/test/java/org/springframework/boot/docs/web/client/SampleWebClientTests.java rename to spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/springbootfeatures/testing/webclient/SampleWebClientTests.java index 117b892a3b..bdbbb339fb 100644 --- a/spring-boot-project/spring-boot-docs/src/test/java/org/springframework/boot/docs/web/client/SampleWebClientTests.java +++ b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/springbootfeatures/testing/webclient/SampleWebClientTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * 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. @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.docs.web.client; +package org.springframework.boot.docs.springbootfeatures.testing.webclient; import java.time.Duration; @@ -36,7 +36,7 @@ import static org.assertj.core.api.Assertions.assertThat; * * @author Stephane Nicoll */ -// tag::test[] +// tag::code[] @SpringBootTest(webEnvironment = WebEnvironment.RANDOM_PORT) class SampleWebClientTests { @@ -61,4 +61,4 @@ class SampleWebClientTests { } } -// end::test[] +// end::code[] diff --git a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/springbootfeatures/validation/package-info.java b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/springbootfeatures/validation/package-info.java new file mode 100644 index 0000000000..16b4e55655 --- /dev/null +++ b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/springbootfeatures/validation/package-info.java @@ -0,0 +1,20 @@ +/* + * 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. + */ + +/** + * Examples for the "Spring Boot Features - Validation" section. + */ +package org.springframework.boot.docs.springbootfeatures.validation; diff --git a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/context/embedded/TomcatServerCustomizerExample.java b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/springbootfeatures/webapplications/TomcatServerCustomizerExample.java similarity index 92% rename from spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/context/embedded/TomcatServerCustomizerExample.java rename to spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/springbootfeatures/webapplications/TomcatServerCustomizerExample.java index 6e17bb63ac..cab19252e7 100644 --- a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/context/embedded/TomcatServerCustomizerExample.java +++ b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/springbootfeatures/webapplications/TomcatServerCustomizerExample.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.docs.context.embedded; +package org.springframework.boot.docs.springbootfeatures.webapplications; import java.time.Duration; @@ -27,7 +27,7 @@ import org.springframework.stereotype.Component; * * @author Stephane Nicoll */ -// tag::configuration[] +// tag::code[] @Component public class TomcatServerCustomizerExample implements WebServerFactoryCustomizer { @@ -38,4 +38,4 @@ public class TomcatServerCustomizerExample implements WebServerFactoryCustomizer } } -// end::configuration[] +// end::code[] diff --git a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/springbootfeatures/webapplications/package-info.java b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/springbootfeatures/webapplications/package-info.java new file mode 100644 index 0000000000..ed5dd710ce --- /dev/null +++ b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/springbootfeatures/webapplications/package-info.java @@ -0,0 +1,20 @@ +/* + * 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. + */ + +/** + * Examples for the "Spring Boot Features - Developing Web Applications" section. + */ +package org.springframework.boot.docs.springbootfeatures.webapplications; diff --git a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/springbootfeatures/webclient/package-info.java b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/springbootfeatures/webclient/package-info.java new file mode 100644 index 0000000000..991a5d5aaa --- /dev/null +++ b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/springbootfeatures/webclient/package-info.java @@ -0,0 +1,20 @@ +/* + * 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. + */ + +/** + * Examples for the "Spring Boot Features - Calling REST Services with WebClient" section. + */ +package org.springframework.boot.docs.springbootfeatures.webclient; diff --git a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/springbootfeatures/websockets/package-info.java b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/springbootfeatures/websockets/package-info.java new file mode 100644 index 0000000000..71cf783a86 --- /dev/null +++ b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/springbootfeatures/websockets/package-info.java @@ -0,0 +1,20 @@ +/* + * 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. + */ + +/** + * Examples for the "Spring Boot Features - WebSockets" section. + */ +package org.springframework.boot.docs.springbootfeatures.websockets; diff --git a/spring-boot-project/spring-boot-docs/src/test/java/org/springframework/boot/docs/context/embedded/TomcatLegacyCookieProcessorExampleTests.java b/spring-boot-project/spring-boot-docs/src/test/java/org/springframework/boot/docs/context/embedded/TomcatLegacyCookieProcessorExampleTests.java index 5fd9dd02e3..320e206acd 100644 --- a/spring-boot-project/spring-boot-docs/src/test/java/org/springframework/boot/docs/context/embedded/TomcatLegacyCookieProcessorExampleTests.java +++ b/spring-boot-project/spring-boot-docs/src/test/java/org/springframework/boot/docs/context/embedded/TomcatLegacyCookieProcessorExampleTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * 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. @@ -21,7 +21,8 @@ import org.apache.tomcat.util.http.LegacyCookieProcessor; import org.junit.jupiter.api.Test; import org.springframework.boot.SpringApplication; -import org.springframework.boot.docs.context.embedded.TomcatLegacyCookieProcessorExample.LegacyCookieProcessorConfiguration; +import org.springframework.boot.docs.howto.embeddedwebservers.TomcatLegacyCookieProcessorExample; +import org.springframework.boot.docs.howto.embeddedwebservers.TomcatLegacyCookieProcessorExample.LegacyCookieProcessorConfiguration; import org.springframework.boot.web.embedded.tomcat.TomcatServletWebServerFactory; import org.springframework.boot.web.embedded.tomcat.TomcatWebServer; import org.springframework.boot.web.server.WebServerFactoryCustomizerBeanPostProcessor; diff --git a/spring-boot-project/spring-boot-docs/src/test/java/org/springframework/boot/docs/actuate/metrics/MetricsHealthMicrometerExportExampleTests.java b/spring-boot-project/spring-boot-docs/src/test/java/org/springframework/boot/docs/howto/actuator/MetricsHealthMicrometerExportExampleTests.java similarity index 95% rename from spring-boot-project/spring-boot-docs/src/test/java/org/springframework/boot/docs/actuate/metrics/MetricsHealthMicrometerExportExampleTests.java rename to spring-boot-project/spring-boot-docs/src/test/java/org/springframework/boot/docs/howto/actuator/MetricsHealthMicrometerExportExampleTests.java index 0a55c60775..da851000f3 100644 --- a/spring-boot-project/spring-boot-docs/src/test/java/org/springframework/boot/docs/actuate/metrics/MetricsHealthMicrometerExportExampleTests.java +++ b/spring-boot-project/spring-boot-docs/src/test/java/org/springframework/boot/docs/howto/actuator/MetricsHealthMicrometerExportExampleTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2020 the original author or authors. + * 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. @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.docs.actuate.metrics; +package org.springframework.boot.docs.howto.actuator; import io.micrometer.core.instrument.Gauge; import io.micrometer.core.instrument.MeterRegistry; diff --git a/spring-boot-project/spring-boot-docs/src/test/java/org/springframework/boot/docs/jdbc/BasicDataSourceExampleTests.java b/spring-boot-project/spring-boot-docs/src/test/java/org/springframework/boot/docs/howto/dataaccess/BasicDataSourceExampleTests.java similarity index 94% rename from spring-boot-project/spring-boot-docs/src/test/java/org/springframework/boot/docs/jdbc/BasicDataSourceExampleTests.java rename to spring-boot-project/spring-boot-docs/src/test/java/org/springframework/boot/docs/howto/dataaccess/BasicDataSourceExampleTests.java index 2d441f5c40..7053ef9b6f 100644 --- a/spring-boot-project/spring-boot-docs/src/test/java/org/springframework/boot/docs/jdbc/BasicDataSourceExampleTests.java +++ b/spring-boot-project/spring-boot-docs/src/test/java/org/springframework/boot/docs/howto/dataaccess/BasicDataSourceExampleTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * 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. @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.docs.jdbc; +package org.springframework.boot.docs.howto.dataaccess; import java.sql.SQLException; diff --git a/spring-boot-project/spring-boot-docs/src/test/java/org/springframework/boot/docs/jdbc/CompleteTwoDataSourcesExampleTests.java b/spring-boot-project/spring-boot-docs/src/test/java/org/springframework/boot/docs/howto/dataaccess/CompleteTwoDataSourcesExampleTests.java similarity index 94% rename from spring-boot-project/spring-boot-docs/src/test/java/org/springframework/boot/docs/jdbc/CompleteTwoDataSourcesExampleTests.java rename to spring-boot-project/spring-boot-docs/src/test/java/org/springframework/boot/docs/howto/dataaccess/CompleteTwoDataSourcesExampleTests.java index 10a801536b..86b2ffd551 100644 --- a/spring-boot-project/spring-boot-docs/src/test/java/org/springframework/boot/docs/jdbc/CompleteTwoDataSourcesExampleTests.java +++ b/spring-boot-project/spring-boot-docs/src/test/java/org/springframework/boot/docs/howto/dataaccess/CompleteTwoDataSourcesExampleTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * 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. @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.docs.jdbc; +package org.springframework.boot.docs.howto.dataaccess; import java.sql.SQLException; diff --git a/spring-boot-project/spring-boot-docs/src/test/java/org/springframework/boot/docs/jdbc/ConfigurableDataSourceExampleTests.java b/spring-boot-project/spring-boot-docs/src/test/java/org/springframework/boot/docs/howto/dataaccess/ConfigurableDataSourceExampleTests.java similarity index 94% rename from spring-boot-project/spring-boot-docs/src/test/java/org/springframework/boot/docs/jdbc/ConfigurableDataSourceExampleTests.java rename to spring-boot-project/spring-boot-docs/src/test/java/org/springframework/boot/docs/howto/dataaccess/ConfigurableDataSourceExampleTests.java index 0e290c19f4..caeea3d1c0 100644 --- a/spring-boot-project/spring-boot-docs/src/test/java/org/springframework/boot/docs/jdbc/ConfigurableDataSourceExampleTests.java +++ b/spring-boot-project/spring-boot-docs/src/test/java/org/springframework/boot/docs/howto/dataaccess/ConfigurableDataSourceExampleTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * 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. @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.docs.jdbc; +package org.springframework.boot.docs.howto.dataaccess; import java.sql.SQLException; diff --git a/spring-boot-project/spring-boot-docs/src/test/java/org/springframework/boot/docs/jdbc/SampleApp.java b/spring-boot-project/spring-boot-docs/src/test/java/org/springframework/boot/docs/howto/dataaccess/SampleApp.java similarity index 90% rename from spring-boot-project/spring-boot-docs/src/test/java/org/springframework/boot/docs/jdbc/SampleApp.java rename to spring-boot-project/spring-boot-docs/src/test/java/org/springframework/boot/docs/howto/dataaccess/SampleApp.java index 4422935073..230ccc2ad7 100644 --- a/spring-boot-project/spring-boot-docs/src/test/java/org/springframework/boot/docs/jdbc/SampleApp.java +++ b/spring-boot-project/spring-boot-docs/src/test/java/org/springframework/boot/docs/howto/dataaccess/SampleApp.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * 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. @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.docs.jdbc; +package org.springframework.boot.docs.howto.dataaccess; import javax.sql.DataSource; diff --git a/spring-boot-project/spring-boot-docs/src/test/java/org/springframework/boot/docs/jdbc/SimpleDataSourceExampleTests.java b/spring-boot-project/spring-boot-docs/src/test/java/org/springframework/boot/docs/howto/dataaccess/SimpleDataSourceExampleTests.java similarity index 94% rename from spring-boot-project/spring-boot-docs/src/test/java/org/springframework/boot/docs/jdbc/SimpleDataSourceExampleTests.java rename to spring-boot-project/spring-boot-docs/src/test/java/org/springframework/boot/docs/howto/dataaccess/SimpleDataSourceExampleTests.java index f64d9b8765..373790bcf1 100644 --- a/spring-boot-project/spring-boot-docs/src/test/java/org/springframework/boot/docs/jdbc/SimpleDataSourceExampleTests.java +++ b/spring-boot-project/spring-boot-docs/src/test/java/org/springframework/boot/docs/howto/dataaccess/SimpleDataSourceExampleTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * 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. @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.docs.jdbc; +package org.springframework.boot.docs.howto.dataaccess; import java.sql.SQLException; diff --git a/spring-boot-project/spring-boot-docs/src/test/java/org/springframework/boot/docs/jdbc/SimpleTwoDataSourcesExampleTests.java b/spring-boot-project/spring-boot-docs/src/test/java/org/springframework/boot/docs/howto/dataaccess/SimpleTwoDataSourcesExampleTests.java similarity index 95% rename from spring-boot-project/spring-boot-docs/src/test/java/org/springframework/boot/docs/jdbc/SimpleTwoDataSourcesExampleTests.java rename to spring-boot-project/spring-boot-docs/src/test/java/org/springframework/boot/docs/howto/dataaccess/SimpleTwoDataSourcesExampleTests.java index 1866436a39..bce2c431a0 100644 --- a/spring-boot-project/spring-boot-docs/src/test/java/org/springframework/boot/docs/jdbc/SimpleTwoDataSourcesExampleTests.java +++ b/spring-boot-project/spring-boot-docs/src/test/java/org/springframework/boot/docs/howto/dataaccess/SimpleTwoDataSourcesExampleTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * 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. @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.docs.jdbc; +package org.springframework.boot.docs.howto.dataaccess; import java.sql.SQLException; diff --git a/spring-boot-project/spring-boot-docs/src/test/java/org/springframework/boot/docs/context/EnvironmentPostProcessorExampleTests.java b/spring-boot-project/spring-boot-docs/src/test/java/org/springframework/boot/docs/howto/springbootapplication/EnvironmentPostProcessorExampleTests.java similarity index 91% rename from spring-boot-project/spring-boot-docs/src/test/java/org/springframework/boot/docs/context/EnvironmentPostProcessorExampleTests.java rename to spring-boot-project/spring-boot-docs/src/test/java/org/springframework/boot/docs/howto/springbootapplication/EnvironmentPostProcessorExampleTests.java index 2dc4ff7f6f..931d8583c5 100644 --- a/spring-boot-project/spring-boot-docs/src/test/java/org/springframework/boot/docs/context/EnvironmentPostProcessorExampleTests.java +++ b/spring-boot-project/spring-boot-docs/src/test/java/org/springframework/boot/docs/howto/springbootapplication/EnvironmentPostProcessorExampleTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * 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. @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.docs.context; +package org.springframework.boot.docs.howto.springbootapplication; import org.junit.jupiter.api.Test; diff --git a/spring-boot-project/spring-boot-docs/src/test/java/org/springframework/boot/docs/context/properties/bind/constructor/AppSystemPropertiesTests.java b/spring-boot-project/spring-boot-docs/src/test/java/org/springframework/boot/docs/springbootfeatures/externalizedconfiguration/duration/constructorbinding/AppSystemPropertiesTests.java similarity index 94% rename from spring-boot-project/spring-boot-docs/src/test/java/org/springframework/boot/docs/context/properties/bind/constructor/AppSystemPropertiesTests.java rename to spring-boot-project/spring-boot-docs/src/test/java/org/springframework/boot/docs/springbootfeatures/externalizedconfiguration/duration/constructorbinding/AppSystemPropertiesTests.java index f64e495896..f2f76bee65 100644 --- a/spring-boot-project/spring-boot-docs/src/test/java/org/springframework/boot/docs/context/properties/bind/constructor/AppSystemPropertiesTests.java +++ b/spring-boot-project/spring-boot-docs/src/test/java/org/springframework/boot/docs/springbootfeatures/externalizedconfiguration/duration/constructorbinding/AppSystemPropertiesTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2020 the original author or authors. + * 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. @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.docs.context.properties.bind.constructor; +package org.springframework.boot.docs.springbootfeatures.externalizedconfiguration.duration.constructorbinding; import java.util.function.Consumer; diff --git a/spring-boot-project/spring-boot-docs/src/test/java/org/springframework/boot/docs/context/properties/bind/javabean/AppSystemPropertiesTests.java b/spring-boot-project/spring-boot-docs/src/test/java/org/springframework/boot/docs/springbootfeatures/externalizedconfiguration/duration/javabeanbinding/AppSystemPropertiesTests.java similarity index 94% rename from spring-boot-project/spring-boot-docs/src/test/java/org/springframework/boot/docs/context/properties/bind/javabean/AppSystemPropertiesTests.java rename to spring-boot-project/spring-boot-docs/src/test/java/org/springframework/boot/docs/springbootfeatures/externalizedconfiguration/duration/javabeanbinding/AppSystemPropertiesTests.java index f9155f5a0c..0d12e58e77 100644 --- a/spring-boot-project/spring-boot-docs/src/test/java/org/springframework/boot/docs/context/properties/bind/javabean/AppSystemPropertiesTests.java +++ b/spring-boot-project/spring-boot-docs/src/test/java/org/springframework/boot/docs/springbootfeatures/externalizedconfiguration/duration/javabeanbinding/AppSystemPropertiesTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2020 the original author or authors. + * 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. @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.docs.context.properties.bind.javabean; +package org.springframework.boot.docs.springbootfeatures.externalizedconfiguration.duration.javabeanbinding; import java.util.function.Consumer; diff --git a/spring-boot-project/spring-boot-docs/src/test/java/org/springframework/boot/docs/builder/SpringApplicationBuilderExampleTests.java b/spring-boot-project/spring-boot-docs/src/test/java/org/springframework/boot/docs/springbootfeatures/springapplication/SpringApplicationBuilderExampleTests.java similarity index 91% rename from spring-boot-project/spring-boot-docs/src/test/java/org/springframework/boot/docs/builder/SpringApplicationBuilderExampleTests.java rename to spring-boot-project/spring-boot-docs/src/test/java/org/springframework/boot/docs/springbootfeatures/springapplication/SpringApplicationBuilderExampleTests.java index 3da2ba10d3..457b994fba 100644 --- a/spring-boot-project/spring-boot-docs/src/test/java/org/springframework/boot/docs/builder/SpringApplicationBuilderExampleTests.java +++ b/spring-boot-project/spring-boot-docs/src/test/java/org/springframework/boot/docs/springbootfeatures/springapplication/SpringApplicationBuilderExampleTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * 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. @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.docs.builder; +package org.springframework.boot.docs.springbootfeatures.springapplication; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; diff --git a/spring-boot-project/spring-boot-docs/src/test/java/org/springframework/boot/docs/springbootfeatures/testing/OutputCaptureTestsTests.java b/spring-boot-project/spring-boot-docs/src/test/java/org/springframework/boot/docs/springbootfeatures/testing/OutputCaptureTestsTests.java new file mode 100644 index 0000000000..e7b6389a6e --- /dev/null +++ b/spring-boot-project/spring-boot-docs/src/test/java/org/springframework/boot/docs/springbootfeatures/testing/OutputCaptureTestsTests.java @@ -0,0 +1,26 @@ +/* + * 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.springbootfeatures.testing; + +/** + * Tests for {@link OutputCaptureTests}. + * + * @author Stephane Nicoll + */ +class OutputCaptureTestsTests extends OutputCaptureTests { + +} diff --git a/spring-boot-project/spring-boot-docs/src/test/java/org/springframework/boot/docs/springbootfeatures/testing/UserServiceAutoConfigurationTestsTests.java b/spring-boot-project/spring-boot-docs/src/test/java/org/springframework/boot/docs/springbootfeatures/testing/UserServiceAutoConfigurationTestsTests.java new file mode 100644 index 0000000000..7f00013f3d --- /dev/null +++ b/spring-boot-project/spring-boot-docs/src/test/java/org/springframework/boot/docs/springbootfeatures/testing/UserServiceAutoConfigurationTestsTests.java @@ -0,0 +1,26 @@ +/* + * 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.springbootfeatures.testing; + +/** + * Tests for {@link UserServiceAutoConfigurationTests}. + * + * @author Stephane Nicoll + */ +class UserServiceAutoConfigurationTestsTests extends UserServiceAutoConfigurationTests { + +} diff --git a/spring-boot-project/spring-boot-docs/src/test/java/org/springframework/boot/docs/springbootfeatures/testing/jmx/SampleJmxTestsTests.java b/spring-boot-project/spring-boot-docs/src/test/java/org/springframework/boot/docs/springbootfeatures/testing/jmx/SampleJmxTestsTests.java new file mode 100644 index 0000000000..9729e9cff8 --- /dev/null +++ b/spring-boot-project/spring-boot-docs/src/test/java/org/springframework/boot/docs/springbootfeatures/testing/jmx/SampleJmxTestsTests.java @@ -0,0 +1,26 @@ +/* + * 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.springbootfeatures.testing.jmx; + +/** + * Tests for SampleJmxTests + * + * @author Stephane Nicoll + */ +class SampleJmxTestsTests extends SampleJmxTests { + +} diff --git a/spring-boot-project/spring-boot-docs/src/test/java/org/springframework/boot/docs/springbootfeatures/testing/webclient/SampleWebClientTestsTests.java b/spring-boot-project/spring-boot-docs/src/test/java/org/springframework/boot/docs/springbootfeatures/testing/webclient/SampleWebClientTestsTests.java new file mode 100644 index 0000000000..323dddb0b3 --- /dev/null +++ b/spring-boot-project/spring-boot-docs/src/test/java/org/springframework/boot/docs/springbootfeatures/testing/webclient/SampleWebClientTestsTests.java @@ -0,0 +1,26 @@ +/* + * 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.springbootfeatures.testing.webclient; + +/** + * Tests for {@link SampleWebClientTests}. + * + * @author Stephane Nicoll + */ +class SampleWebClientTestsTests extends SampleWebClientTests { + +}