Replace @EnableBatchProcessing in slice test examples
Using `@EnableBatchProcessing` is no longer necessary to enable Batch's auto-configuration so it's no longer a good example when discussing sliced tests and user configuration. This commit replaces `@EnableBatchProcessing` with an alternative annotation, `@EnableMongoAuditing` and updates the accompanying text. Closes gh-33435
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2021 the original author or authors.
|
||||
* Copyright 2012-2023 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.
|
||||
@@ -16,11 +16,11 @@
|
||||
|
||||
package org.springframework.boot.docs.features.testing.springbootapplications.userconfigurationandslicing;
|
||||
|
||||
import org.springframework.batch.core.configuration.annotation.EnableBatchProcessing;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
import org.springframework.data.mongodb.config.EnableMongoAuditing;
|
||||
|
||||
@SpringBootApplication
|
||||
@EnableBatchProcessing
|
||||
@EnableMongoAuditing
|
||||
public class MyApplication {
|
||||
|
||||
// ...
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2021 the original author or authors.
|
||||
* Copyright 2012-2023 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.
|
||||
@@ -16,12 +16,12 @@
|
||||
|
||||
package org.springframework.boot.docs.features.testing.springbootapplications.userconfigurationandslicing;
|
||||
|
||||
import org.springframework.batch.core.configuration.annotation.EnableBatchProcessing;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.data.mongodb.config.EnableMongoAuditing;
|
||||
|
||||
@Configuration(proxyBeanMethods = false)
|
||||
@EnableBatchProcessing
|
||||
public class MyBatchConfiguration {
|
||||
@EnableMongoAuditing
|
||||
public class MyMongoConfiguration {
|
||||
|
||||
// ...
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2022 the original author or authors.
|
||||
* Copyright 2012-2023 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.
|
||||
@@ -16,11 +16,11 @@
|
||||
|
||||
package org.springframework.boot.docs.features.testing.springbootapplications.userconfigurationandslicing
|
||||
|
||||
import org.springframework.batch.core.configuration.annotation.EnableBatchProcessing
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication
|
||||
import org.springframework.data.mongodb.config.EnableMongoAuditing
|
||||
|
||||
@SpringBootApplication
|
||||
@EnableBatchProcessing
|
||||
@EnableMongoAuditing
|
||||
class MyApplication {
|
||||
|
||||
// ...
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2022 the original author or authors.
|
||||
* Copyright 2012-2023 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.
|
||||
@@ -16,12 +16,12 @@
|
||||
|
||||
package org.springframework.boot.docs.features.testing.springbootapplications.userconfigurationandslicing
|
||||
|
||||
import org.springframework.batch.core.configuration.annotation.EnableBatchProcessing
|
||||
import org.springframework.context.annotation.Configuration
|
||||
import org.springframework.data.mongodb.config.EnableMongoAuditing;
|
||||
|
||||
@Configuration(proxyBeanMethods = false)
|
||||
@EnableBatchProcessing
|
||||
class MyBatchConfiguration {
|
||||
@EnableMongoAuditing
|
||||
class MyMongoConfiguration {
|
||||
|
||||
// ...
|
||||
|
||||
Reference in New Issue
Block a user