Skip to content

Commit c6a9aa5

Browse files
committed
Remove BDDMockito Checkstyle rule
This commit removes the BDDMockito Checkstyle rule, since it did not actually enforce the use of BDDMockito. This commit also updates static imports to use Mockito instead of BDDMockito where appropriate (automated via the Eclipse IDE Organize Imports clean-up task). Closes gh-34616
1 parent ad949a7 commit c6a9aa5

File tree

37 files changed

+111
-121
lines changed

37 files changed

+111
-121
lines changed

spring-aop/src/test/java/org/springframework/aop/interceptor/AsyncExecutionInterceptorTests.java

+1-2
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,12 @@
2727
import org.springframework.core.task.AsyncTaskExecutor;
2828

2929
import static org.assertj.core.api.Assertions.assertThat;
30+
import static org.mockito.ArgumentMatchers.any;
3031
import static org.mockito.BDDMockito.given;
31-
import static org.mockito.Mockito.any;
3232
import static org.mockito.Mockito.mock;
3333
import static org.mockito.Mockito.spy;
3434
import static org.mockito.Mockito.verify;
3535

36-
3736
/**
3837
* Tests for {@link AsyncExecutionInterceptor}.
3938
*

spring-core/src/test/java/org/springframework/core/log/CompositeLogTests.java

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2024 the original author or authors.
2+
* Copyright 2002-2025 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -21,11 +21,10 @@
2121
import org.apache.commons.logging.Log;
2222
import org.junit.jupiter.api.Test;
2323

24-
import static org.mockito.BDDMockito.when;
2524
import static org.mockito.Mockito.mock;
2625
import static org.mockito.Mockito.verify;
2726
import static org.mockito.Mockito.verifyNoMoreInteractions;
28-
27+
import static org.mockito.Mockito.when;
2928

3029
/**
3130
* Tests for {@link CompositeLog}.

spring-expression/src/test/java/org/springframework/expression/spel/IndexingTests.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2024 the original author or authors.
2+
* Copyright 2002-2025 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -57,8 +57,8 @@
5757
import static org.assertj.core.api.Assertions.assertThatExceptionOfType;
5858
import static org.mockito.ArgumentMatchers.any;
5959
import static org.mockito.ArgumentMatchers.eq;
60-
import static org.mockito.BDDMockito.doThrow;
6160
import static org.mockito.BDDMockito.given;
61+
import static org.mockito.Mockito.doThrow;
6262
import static org.mockito.Mockito.mock;
6363
import static org.mockito.Mockito.times;
6464
import static org.mockito.Mockito.verify;

spring-jdbc/src/test/java/org/springframework/jdbc/core/StatementCreatorUtilsTests.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2024 the original author or authors.
2+
* Copyright 2002-2025 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -38,8 +38,8 @@
3838

3939
import static org.assertj.core.api.Assertions.assertThat;
4040
import static org.junit.jupiter.api.Named.named;
41-
import static org.mockito.BDDMockito.doThrow;
4241
import static org.mockito.BDDMockito.given;
42+
import static org.mockito.Mockito.doThrow;
4343
import static org.mockito.Mockito.mock;
4444
import static org.mockito.Mockito.never;
4545
import static org.mockito.Mockito.verify;

spring-jdbc/src/test/java/org/springframework/jdbc/datasource/DataSourceUtilsTests.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2023 the original author or authors.
2+
* Copyright 2002-2025 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -25,8 +25,8 @@
2525
import org.springframework.jdbc.CannotGetJdbcConnectionException;
2626

2727
import static org.assertj.core.api.Assertions.assertThatThrownBy;
28-
import static org.mockito.BDDMockito.when;
2928
import static org.mockito.Mockito.mock;
29+
import static org.mockito.Mockito.when;
3030

3131
/**
3232
* Tests for {@link DataSourceUtils}.

spring-jdbc/src/test/java/org/springframework/jdbc/datasource/ShardingKeyDataSourceAdapterTests.java

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2024 the original author or authors.
2+
* Copyright 2002-2025 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -27,10 +27,10 @@
2727
import org.junit.jupiter.api.Test;
2828

2929
import static org.assertj.core.api.Assertions.assertThat;
30-
import static org.mockito.BDDMockito.RETURNS_DEEP_STUBS;
3130
import static org.mockito.BDDMockito.given;
32-
import static org.mockito.BDDMockito.mock;
33-
import static org.mockito.BDDMockito.when;
31+
import static org.mockito.Mockito.RETURNS_DEEP_STUBS;
32+
import static org.mockito.Mockito.mock;
33+
import static org.mockito.Mockito.when;
3434

3535
/**
3636
* Tests for {@link ShardingKeyDataSourceAdapter}.

spring-jdbc/src/test/java/org/springframework/jdbc/datasource/init/ResourceDatabasePopulatorTests.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2024 the original author or authors.
2+
* Copyright 2002-2025 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -22,7 +22,7 @@
2222

2323
import static org.assertj.core.api.Assertions.assertThat;
2424
import static org.assertj.core.api.Assertions.assertThatIllegalArgumentException;
25-
import static org.mockito.BDDMockito.mock;
25+
import static org.mockito.Mockito.mock;
2626

2727
/**
2828
* Tests for {@link ResourceDatabasePopulator}.

spring-jdbc/src/test/java/org/springframework/jdbc/support/SqlArrayValueTests.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2023 the original author or authors.
2+
* Copyright 2002-2025 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -24,8 +24,8 @@
2424
import org.junit.jupiter.api.Test;
2525

2626
import static org.mockito.BDDMockito.given;
27-
import static org.mockito.BDDMockito.mock;
28-
import static org.mockito.BDDMockito.verify;
27+
import static org.mockito.Mockito.mock;
28+
import static org.mockito.Mockito.verify;
2929

3030
/**
3131
* Tests for {@link SqlArrayValue}.

spring-r2dbc/src/test/java/org/springframework/r2dbc/connection/DelegatingConnectionFactoryTests.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2024 the original author or authors.
2+
* Copyright 2002-2025 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -22,8 +22,8 @@
2222
import reactor.core.publisher.Mono;
2323

2424
import static org.assertj.core.api.Assertions.assertThat;
25-
import static org.mockito.BDDMockito.mock;
26-
import static org.mockito.BDDMockito.when;
25+
import static org.mockito.Mockito.mock;
26+
import static org.mockito.Mockito.when;
2727

2828
/**
2929
* Tests for {@link DelegatingConnectionFactory}.

spring-r2dbc/src/test/java/org/springframework/r2dbc/connection/R2dbcTransactionManagerTests.java

+8-8
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2024 the original author or authors.
2+
* Copyright 2002-2025 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -46,13 +46,13 @@
4646
import static org.mockito.ArgumentMatchers.any;
4747
import static org.mockito.ArgumentMatchers.anyBoolean;
4848
import static org.mockito.ArgumentMatchers.anyString;
49-
import static org.mockito.BDDMockito.inOrder;
50-
import static org.mockito.BDDMockito.mock;
51-
import static org.mockito.BDDMockito.never;
52-
import static org.mockito.BDDMockito.reset;
53-
import static org.mockito.BDDMockito.verify;
54-
import static org.mockito.BDDMockito.verifyNoMoreInteractions;
55-
import static org.mockito.BDDMockito.when;
49+
import static org.mockito.Mockito.inOrder;
50+
import static org.mockito.Mockito.mock;
51+
import static org.mockito.Mockito.never;
52+
import static org.mockito.Mockito.reset;
53+
import static org.mockito.Mockito.verify;
54+
import static org.mockito.Mockito.verifyNoMoreInteractions;
55+
import static org.mockito.Mockito.when;
5656

5757
/**
5858
* Tests for {@link R2dbcTransactionManager}.

spring-r2dbc/src/test/java/org/springframework/r2dbc/connection/SingleConnectionFactoryTests.java

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2024 the original author or authors.
2+
* Copyright 2002-2025 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -27,10 +27,10 @@
2727
import reactor.test.StepVerifier;
2828

2929
import static org.assertj.core.api.Assertions.assertThat;
30-
import static org.mockito.BDDMockito.mock;
31-
import static org.mockito.BDDMockito.never;
32-
import static org.mockito.BDDMockito.verify;
33-
import static org.mockito.BDDMockito.when;
30+
import static org.mockito.Mockito.mock;
31+
import static org.mockito.Mockito.never;
32+
import static org.mockito.Mockito.verify;
33+
import static org.mockito.Mockito.when;
3434

3535
/**
3636
* Tests for {@link SingleConnectionFactory}.

spring-r2dbc/src/test/java/org/springframework/r2dbc/connection/TransactionAwareConnectionFactoryProxyTests.java

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2024 the original author or authors.
2+
* Copyright 2002-2025 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -31,11 +31,11 @@
3131

3232
import static org.assertj.core.api.Assertions.assertThat;
3333
import static org.assertj.core.api.Assertions.assertThatIllegalStateException;
34-
import static org.mockito.BDDMockito.mock;
35-
import static org.mockito.BDDMockito.times;
36-
import static org.mockito.BDDMockito.verify;
37-
import static org.mockito.BDDMockito.verifyNoInteractions;
38-
import static org.mockito.BDDMockito.when;
34+
import static org.mockito.Mockito.mock;
35+
import static org.mockito.Mockito.times;
36+
import static org.mockito.Mockito.verify;
37+
import static org.mockito.Mockito.verifyNoInteractions;
38+
import static org.mockito.Mockito.when;
3939

4040
/**
4141
* Tests for {@link TransactionAwareConnectionFactoryProxy}.

spring-r2dbc/src/test/java/org/springframework/r2dbc/connection/init/CompositeDatabasePopulatorTests.java

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2024 the original author or authors.
2+
* Copyright 2002-2025 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -25,10 +25,10 @@
2525
import reactor.core.publisher.Mono;
2626
import reactor.test.StepVerifier;
2727

28-
import static org.mockito.BDDMockito.mock;
29-
import static org.mockito.BDDMockito.times;
30-
import static org.mockito.BDDMockito.verify;
31-
import static org.mockito.BDDMockito.when;
28+
import static org.mockito.Mockito.mock;
29+
import static org.mockito.Mockito.times;
30+
import static org.mockito.Mockito.verify;
31+
import static org.mockito.Mockito.when;
3232

3333
/**
3434
* Tests for {@link CompositeDatabasePopulator}.

spring-r2dbc/src/test/java/org/springframework/r2dbc/connection/init/ConnectionFactoryInitializerTests.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2024 the original author or authors.
2+
* Copyright 2002-2025 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -24,8 +24,8 @@
2424
import reactor.core.publisher.Mono;
2525

2626
import static org.assertj.core.api.Assertions.assertThat;
27-
import static org.mockito.BDDMockito.mock;
28-
import static org.mockito.BDDMockito.when;
27+
import static org.mockito.Mockito.mock;
28+
import static org.mockito.Mockito.when;
2929

3030
/**
3131
* Tests for {@link ConnectionFactoryInitializer}.

spring-r2dbc/src/test/java/org/springframework/r2dbc/connection/init/ResourceDatabasePopulatorTests.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2024 the original author or authors.
2+
* Copyright 2002-2025 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -22,7 +22,7 @@
2222

2323
import static org.assertj.core.api.Assertions.assertThat;
2424
import static org.assertj.core.api.Assertions.assertThatIllegalArgumentException;
25-
import static org.mockito.BDDMockito.mock;
25+
import static org.mockito.Mockito.mock;
2626

2727
/**
2828
* Tests for {@link ResourceDatabasePopulator}.

spring-r2dbc/src/test/java/org/springframework/r2dbc/connection/lookup/BeanFactoryConnectionFactoryLookupTests.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2024 the original author or authors.
2+
* Copyright 2002-2025 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -28,8 +28,8 @@
2828
import static org.assertj.core.api.Assertions.assertThat;
2929
import static org.assertj.core.api.Assertions.assertThatExceptionOfType;
3030
import static org.assertj.core.api.Assertions.assertThatThrownBy;
31-
import static org.mockito.BDDMockito.mock;
32-
import static org.mockito.BDDMockito.when;
31+
import static org.mockito.Mockito.mock;
32+
import static org.mockito.Mockito.when;
3333

3434
/**
3535
* Tests for {@link BeanFactoryConnectionFactoryLookup}.

spring-r2dbc/src/test/java/org/springframework/r2dbc/core/DefaultDatabaseClientTests.java

+9-9
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2024 the original author or authors.
2+
* Copyright 2002-2025 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -50,14 +50,14 @@
5050
import static org.assertj.core.api.Assertions.assertThat;
5151
import static org.mockito.ArgumentMatchers.anyString;
5252
import static org.mockito.ArgumentMatchers.eq;
53-
import static org.mockito.BDDMockito.doReturn;
54-
import static org.mockito.BDDMockito.inOrder;
55-
import static org.mockito.BDDMockito.mock;
56-
import static org.mockito.BDDMockito.times;
57-
import static org.mockito.BDDMockito.verify;
58-
import static org.mockito.BDDMockito.verifyNoInteractions;
59-
import static org.mockito.BDDMockito.verifyNoMoreInteractions;
60-
import static org.mockito.BDDMockito.when;
53+
import static org.mockito.Mockito.doReturn;
54+
import static org.mockito.Mockito.inOrder;
55+
import static org.mockito.Mockito.mock;
56+
import static org.mockito.Mockito.times;
57+
import static org.mockito.Mockito.verify;
58+
import static org.mockito.Mockito.verifyNoInteractions;
59+
import static org.mockito.Mockito.verifyNoMoreInteractions;
60+
import static org.mockito.Mockito.when;
6161

6262
/**
6363
* Tests for {@link DefaultDatabaseClient}.

spring-test/src/test/java/org/springframework/test/context/aot/AotContextLoaderTests.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@
2525
import org.springframework.test.context.MergedContextConfiguration;
2626

2727
import static org.assertj.core.api.Assertions.assertThat;
28-
import static org.mockito.BDDMockito.never;
29-
import static org.mockito.BDDMockito.spy;
3028
import static org.mockito.BDDMockito.then;
29+
import static org.mockito.Mockito.never;
30+
import static org.mockito.Mockito.spy;
3131

3232
/**
3333
* Unit tests for {@link AotContextLoader}.

spring-test/src/test/java/org/springframework/test/context/aot/samples/bean/override/MockitoBeanJupiterTests.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2024 the original author or authors.
2+
* Copyright 2002-2025 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -28,7 +28,7 @@
2828
import org.springframework.test.context.junit.jupiter.SpringJUnitConfig;
2929

3030
import static org.assertj.core.api.Assertions.assertThat;
31-
import static org.mockito.BDDMockito.when;
31+
import static org.mockito.Mockito.when;
3232

3333
/**
3434
* @author Sam Brannen

spring-test/src/test/java/org/springframework/test/context/bean/override/mockito/MockitoBeanForBrokenFactoryBeanIntegrationTests.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2024 the original author or authors.
2+
* Copyright 2002-2025 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -26,7 +26,7 @@
2626
import org.springframework.test.context.junit.jupiter.SpringJUnitConfig;
2727

2828
import static org.assertj.core.api.Assertions.assertThat;
29-
import static org.mockito.BDDMockito.when;
29+
import static org.mockito.Mockito.when;
3030

3131
/**
3232
* Test {@link MockitoBean @MockitoBean} for a {@link FactoryBean} that is

spring-test/src/test/java/org/springframework/test/context/bean/override/mockito/MockitoBeanForByTypeLookupIntegrationTests.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2024 the original author or authors.
2+
* Copyright 2002-2025 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -33,10 +33,10 @@
3333
import static org.assertj.core.api.Assertions.assertThat;
3434
import static org.assertj.core.api.Assertions.assertThatExceptionOfType;
3535
import static org.mockito.ArgumentMatchers.anyInt;
36-
import static org.mockito.BDDMockito.when;
3736
import static org.mockito.Mockito.times;
3837
import static org.mockito.Mockito.verify;
3938
import static org.mockito.Mockito.verifyNoMoreInteractions;
39+
import static org.mockito.Mockito.when;
4040
import static org.springframework.test.mockito.MockitoAssertions.assertIsMock;
4141

4242
/**

0 commit comments

Comments
 (0)