Polish "Enforce use of BDDMockito"
See gh-29178
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2021 the original author or authors.
|
||||
* Copyright 2012-2022 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.
|
||||
@@ -38,7 +38,6 @@ import static org.mockito.BDDMockito.then;
|
||||
* {@link AssertProviderApplicationContextInvocationHandler}.
|
||||
*
|
||||
* @author Phillip Webb
|
||||
* @author Yanming Zhou
|
||||
*/
|
||||
@ExtendWith(MockitoExtension.class)
|
||||
class ApplicationContextAssertProviderTests {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2021 the original author or authors.
|
||||
* Copyright 2012-2022 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.
|
||||
@@ -36,7 +36,6 @@ import static org.mockito.Mockito.times;
|
||||
* enclosing class (the default behaviour).
|
||||
*
|
||||
* @author Andy Wilkinson
|
||||
* @author Yanming Zhou
|
||||
*/
|
||||
@SpringBootTest(classes = AppConfiguration.class)
|
||||
@Import(ActionPerformer.class)
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2021 the original author or authors.
|
||||
* Copyright 2012-2022 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.
|
||||
@@ -39,7 +39,6 @@ import static org.mockito.BDDMockito.then;
|
||||
*
|
||||
* @author Stephane Nicoll
|
||||
* @author Phillip Webb
|
||||
* @author Yanming Zhou
|
||||
*/
|
||||
@ExtendWith(SpringExtension.class)
|
||||
class MockBeanOnTestFieldForExistingBeanWithQualifierIntegrationTests {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2021 the original author or authors.
|
||||
* Copyright 2012-2022 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.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2021 the original author or authors.
|
||||
* Copyright 2012-2022 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.
|
||||
@@ -41,7 +41,6 @@ import static org.mockito.Mockito.mock;
|
||||
* Tests for {@link MockitoTestExecutionListener}.
|
||||
*
|
||||
* @author Phillip Webb
|
||||
* @author Yanming Zhou
|
||||
*/
|
||||
@ExtendWith(MockitoExtension.class)
|
||||
class MockitoTestExecutionListenerTests {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2021 the original author or authors.
|
||||
* Copyright 2012-2022 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.
|
||||
@@ -42,7 +42,6 @@ import static org.mockito.BDDMockito.then;
|
||||
* Tests for {@link QualifierDefinition}.
|
||||
*
|
||||
* @author Phillip Webb
|
||||
* @author Yanming Zhou
|
||||
*/
|
||||
@ExtendWith(MockitoExtension.class)
|
||||
class QualifierDefinitionTests {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2021 the original author or authors.
|
||||
* Copyright 2012-2022 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.
|
||||
@@ -34,7 +34,6 @@ import static org.mockito.BDDMockito.then;
|
||||
* beans.
|
||||
*
|
||||
* @author Phillip Webb
|
||||
* @author Yanming ZHou
|
||||
*/
|
||||
@ExtendWith(SpringExtension.class)
|
||||
class SpyBeanOnConfigurationClassForExistingBeanIntegrationTests {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2021 the original author or authors.
|
||||
* Copyright 2012-2022 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.
|
||||
@@ -34,7 +34,6 @@ import static org.mockito.BDDMockito.then;
|
||||
* instances.
|
||||
*
|
||||
* @author Phillip Webb
|
||||
* @author Yanming Zhou
|
||||
*/
|
||||
@ExtendWith(SpringExtension.class)
|
||||
class SpyBeanOnConfigurationClassForNewBeanIntegrationTests {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2021 the original author or authors.
|
||||
* Copyright 2012-2022 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.
|
||||
@@ -35,7 +35,6 @@ import static org.mockito.BDDMockito.then;
|
||||
* to replace existing beans.
|
||||
*
|
||||
* @author Phillip Webb
|
||||
* @author Yanming Zhou
|
||||
*/
|
||||
@ExtendWith(SpringExtension.class)
|
||||
class SpyBeanOnConfigurationFieldForExistingBeanIntegrationTests {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2021 the original author or authors.
|
||||
* Copyright 2012-2022 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.
|
||||
@@ -34,7 +34,6 @@ import static org.mockito.BDDMockito.then;
|
||||
* to inject new spy instances.
|
||||
*
|
||||
* @author Phillip Webb
|
||||
* @author Yanming Zhou
|
||||
*/
|
||||
@ExtendWith(SpringExtension.class)
|
||||
class SpyBeanOnConfigurationFieldForNewBeanIntegrationTests {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2021 the original author or authors.
|
||||
* Copyright 2012-2022 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.
|
||||
@@ -33,7 +33,6 @@ import static org.mockito.BDDMockito.then;
|
||||
* Test {@link SpyBean @SpyBean} on a test class can be used to replace existing beans.
|
||||
*
|
||||
* @author Phillip Webb
|
||||
* @author Yanming Zhou
|
||||
*/
|
||||
@ExtendWith(SpringExtension.class)
|
||||
@SpyBean(SimpleExampleService.class)
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2021 the original author or authors.
|
||||
* Copyright 2012-2022 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.
|
||||
@@ -33,7 +33,6 @@ import static org.mockito.BDDMockito.then;
|
||||
* Test {@link SpyBean @SpyBean} on a test class can be used to inject new spy instances.
|
||||
*
|
||||
* @author Phillip Webb
|
||||
* @author Yanming Zhou
|
||||
*/
|
||||
@ExtendWith(SpringExtension.class)
|
||||
@SpyBean(SimpleExampleService.class)
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2021 the original author or authors.
|
||||
* Copyright 2012-2022 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.
|
||||
@@ -35,7 +35,6 @@ import static org.mockito.BDDMockito.then;
|
||||
* application context caching.
|
||||
*
|
||||
* @author Phillip Webb
|
||||
* @author Yanming Zhou
|
||||
* @see SpyBeanOnTestFieldForExistingBeanIntegrationTests
|
||||
*/
|
||||
@ExtendWith(SpringExtension.class)
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2021 the original author or authors.
|
||||
* Copyright 2012-2022 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.
|
||||
@@ -33,7 +33,6 @@ import static org.mockito.BDDMockito.then;
|
||||
* beans.
|
||||
*
|
||||
* @author Phillip Webb
|
||||
* @author Yanming Zhou
|
||||
* @see SpyBeanOnTestFieldForExistingBeanCacheIntegrationTests
|
||||
*/
|
||||
@ExtendWith(SpringExtension.class)
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2021 the original author or authors.
|
||||
* Copyright 2012-2022 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.
|
||||
@@ -38,7 +38,6 @@ import static org.mockito.BDDMockito.then;
|
||||
* bean while preserving qualifiers.
|
||||
*
|
||||
* @author Andreas Neiser
|
||||
* @author Yanming Zhou
|
||||
*/
|
||||
@ExtendWith(SpringExtension.class)
|
||||
class SpyBeanOnTestFieldForExistingBeanWithQualifierIntegrationTests {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2021 the original author or authors.
|
||||
* Copyright 2012-2022 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.
|
||||
@@ -37,7 +37,6 @@ import static org.mockito.BDDMockito.then;
|
||||
* beans.
|
||||
*
|
||||
* @author Phillip Webb
|
||||
* @author Yanming Zhou
|
||||
* @see SpyBeanOnTestFieldForExistingBeanCacheIntegrationTests
|
||||
*/
|
||||
@ExtendWith(SpringExtension.class)
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2021 the original author or authors.
|
||||
* Copyright 2012-2022 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.
|
||||
@@ -37,7 +37,6 @@ import static org.mockito.BDDMockito.then;
|
||||
* instance when there are multiple candidates and one is primary.
|
||||
*
|
||||
* @author Phillip Webb
|
||||
* @author Yanming Zhou
|
||||
*/
|
||||
@ExtendWith(SpringExtension.class)
|
||||
class SpyBeanOnTestFieldForMultipleExistingBeansWithOnePrimaryIntegrationTests {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2021 the original author or authors.
|
||||
* Copyright 2012-2022 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.
|
||||
@@ -34,7 +34,6 @@ import static org.mockito.BDDMockito.then;
|
||||
* instances.
|
||||
*
|
||||
* @author Phillip Webb
|
||||
* @author Yanming Zhou
|
||||
*/
|
||||
@ExtendWith(SpringExtension.class)
|
||||
class SpyBeanOnTestFieldForNewBeanIntegrationTests {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2021 the original author or authors.
|
||||
* Copyright 2012-2022 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.
|
||||
@@ -42,7 +42,6 @@ import static org.mockito.Mockito.reset;
|
||||
* Test {@link SpyBean @SpyBean} when mixed with Spring AOP.
|
||||
*
|
||||
* @author Phillip Webb
|
||||
* @author Yanming Zhou
|
||||
* @see <a href="https://github.com/spring-projects/spring-boot/issues/5837">5837</a>
|
||||
*/
|
||||
@ExtendWith(SpringExtension.class)
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2021 the original author or authors.
|
||||
* Copyright 2012-2022 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.
|
||||
@@ -42,7 +42,6 @@ import static org.mockito.BDDMockito.then;
|
||||
* Test {@link SpyBean @SpyBean} when mixed with Spring AOP.
|
||||
*
|
||||
* @author Phillip Webb
|
||||
* @author Yanming Zhou
|
||||
* @see <a href="https://github.com/spring-projects/spring-boot/issues/5837">5837</a>
|
||||
*/
|
||||
@ExtendWith(SpringExtension.class)
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2021 the original author or authors.
|
||||
* Copyright 2012-2022 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.
|
||||
@@ -35,7 +35,6 @@ import static org.mockito.BDDMockito.then;
|
||||
* {@link DirtiesContext @DirtiesContext} and {@link ClassMode#BEFORE_EACH_TEST_METHOD}.
|
||||
*
|
||||
* @author Andy Wilkinson
|
||||
* @author Yanming Zhou
|
||||
*/
|
||||
@ExtendWith(SpringExtension.class)
|
||||
@DirtiesContext(classMode = ClassMode.BEFORE_EACH_TEST_METHOD)
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2021 the original author or authors.
|
||||
* Copyright 2012-2022 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.
|
||||
@@ -36,7 +36,6 @@ import static org.mockito.BDDMockito.then;
|
||||
* Tests for {@link SpyBean @SpyBean} with a JDK proxy.
|
||||
*
|
||||
* @author Andy Wilkinson
|
||||
* @author Yanming Zhou
|
||||
*/
|
||||
@ExtendWith(SpringExtension.class)
|
||||
class SpyBeanWithJdkProxyTests {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2021 the original author or authors.
|
||||
* Copyright 2012-2022 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.
|
||||
@@ -29,7 +29,6 @@ import static org.mockito.Mockito.mock;
|
||||
* Tests for {@link ApplicationContextTestUtils}.
|
||||
*
|
||||
* @author Stephane Nicoll
|
||||
* @author Yanming Zhou
|
||||
*/
|
||||
class ApplicationContextTestUtilsTests {
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2021 the original author or authors.
|
||||
* Copyright 2012-2022 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.
|
||||
@@ -37,7 +37,6 @@ import static org.mockito.Mockito.mock;
|
||||
* @author Phillip Webb
|
||||
* @author Andy Wilkinson
|
||||
* @author Eddú Meléndez
|
||||
* @author Yanming Zhou
|
||||
*/
|
||||
class LocalHostUriTemplateHandlerTests {
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2021 the original author or authors.
|
||||
* Copyright 2012-2022 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.
|
||||
@@ -49,7 +49,6 @@ import static org.springframework.test.web.client.response.MockRestResponseCreat
|
||||
* Tests for {@link RootUriRequestExpectationManager}.
|
||||
*
|
||||
* @author Phillip Webb
|
||||
* @author Yanming Zhou
|
||||
*/
|
||||
@ExtendWith(MockitoExtension.class)
|
||||
class RootUriRequestExpectationManagerTests {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2021 the original author or authors.
|
||||
* Copyright 2012-2022 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.
|
||||
@@ -67,7 +67,6 @@ import static org.mockito.Mockito.mock;
|
||||
* @author Stephane Nicoll
|
||||
* @author Andy Wilkinson
|
||||
* @author Kristine Jetzke
|
||||
* @author Yanming Zhou
|
||||
*/
|
||||
class TestRestTemplateTests {
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2021 the original author or authors.
|
||||
* Copyright 2012-2022 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.
|
||||
@@ -43,7 +43,6 @@ import static org.mockito.Mockito.mock;
|
||||
* Tests for {@link LocalHostWebClient}.
|
||||
*
|
||||
* @author Phillip Webb
|
||||
* @author Yanming Zhou
|
||||
*/
|
||||
@SuppressWarnings("resource")
|
||||
@ExtendWith(MockitoExtension.class)
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2020 the original author or authors.
|
||||
* Copyright 2012-2022 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.
|
||||
@@ -45,7 +45,6 @@ import static org.mockito.Mockito.mock;
|
||||
* Tests for {@link LocalHostWebConnectionHtmlUnitDriver}.
|
||||
*
|
||||
* @author Phillip Webb
|
||||
* @author Yanming Zhou
|
||||
*/
|
||||
@ExtendWith(MockitoExtension.class)
|
||||
class LocalHostWebConnectionHtmlUnitDriverTests {
|
||||
@@ -92,7 +91,8 @@ class LocalHostWebConnectionHtmlUnitDriverTests {
|
||||
MockEnvironment environment = new MockEnvironment();
|
||||
LocalHostWebConnectionHtmlUnitDriver driver = new TestLocalHostWebConnectionHtmlUnitDriver(environment);
|
||||
driver.get("/test");
|
||||
then(this.webClient).should().getPage(any(WebWindow.class), requestToUrl(new URL("http://localhost:8080/test")));
|
||||
then(this.webClient).should().getPage(any(WebWindow.class),
|
||||
requestToUrl(new URL("http://localhost:8080/test")));
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -101,7 +101,8 @@ class LocalHostWebConnectionHtmlUnitDriverTests {
|
||||
environment.setProperty("local.server.port", "8181");
|
||||
LocalHostWebConnectionHtmlUnitDriver driver = new TestLocalHostWebConnectionHtmlUnitDriver(environment);
|
||||
driver.get("/test");
|
||||
then(this.webClient).should().getPage(any(WebWindow.class), requestToUrl(new URL("http://localhost:8181/test")));
|
||||
then(this.webClient).should().getPage(any(WebWindow.class),
|
||||
requestToUrl(new URL("http://localhost:8181/test")));
|
||||
}
|
||||
|
||||
private WebRequest requestToUrl(URL url) {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2021 the original author or authors.
|
||||
* Copyright 2012-2022 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.
|
||||
@@ -43,7 +43,6 @@ import static org.mockito.Mockito.mock;
|
||||
* Integration test for {@link WebTestClientContextCustomizer}.
|
||||
*
|
||||
* @author Phillip Webb
|
||||
* @author Yanming Zhou
|
||||
*/
|
||||
@SpringBootTest(webEnvironment = WebEnvironment.RANDOM_PORT, properties = "spring.main.web-application-type=reactive")
|
||||
@DirtiesContext
|
||||
|
||||
Reference in New Issue
Block a user