Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in / Register
Toggle navigation
S
spring-boot
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
DEMO
spring-boot
Commits
77f9bb09
Commit
77f9bb09
authored
Jan 05, 2017
by
Phillip Webb
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Further Polish Mockito 2 support
See gh-7770
parent
1169f693
Changes
60
Hide whitespace changes
Inline
Side-by-side
Showing
60 changed files
with
96 additions
and
103 deletions
+96
-103
MetricExportAutoConfigurationTests.java
...ate/autoconfigure/MetricExportAutoConfigurationTests.java
+1
-1
MetricFilterAutoConfigurationTests.java
...ate/autoconfigure/MetricFilterAutoConfigurationTests.java
+3
-3
ElasticsearchHealthIndicatorTests.java
...oot/actuate/health/ElasticsearchHealthIndicatorTests.java
+1
-1
ElasticsearchJestHealthIndicatorTests.java
...actuate/health/ElasticsearchJestHealthIndicatorTests.java
+1
-1
DropwizardMetricServicesTests.java
...ate/metrics/dropwizard/DropwizardMetricServicesTests.java
+1
-1
OpenTsdbGaugeWriterTests.java
...ot/actuate/metrics/opentsdb/OpenTsdbGaugeWriterTests.java
+2
-2
AuthenticationAuditListenerTests.java
...ot/actuate/security/AuthenticationAuditListenerTests.java
+2
-2
MockCachingProvider.java
...boot/autoconfigure/cache/support/MockCachingProvider.java
+2
-2
Neo4jDataAutoConfigurationTests.java
...configure/data/neo4j/Neo4jDataAutoConfigurationTests.java
+1
-1
AutoConfigurationReportLoggingInitializerTests.java
...gging/AutoConfigurationReportLoggingInitializerTests.java
+3
-3
UserInfoTokenServicesTests.java
.../security/oauth2/resource/UserInfoTokenServicesTests.java
+2
-2
DefaultErrorViewResolverTests.java
...boot/autoconfigure/web/DefaultErrorViewResolverTests.java
+2
-2
EmbeddedServletContainerServletContextListenerTests.java
.../EmbeddedServletContainerServletContextListenerTests.java
+1
-1
ServerPropertiesTests.java
...amework/boot/autoconfigure/web/ServerPropertiesTests.java
+1
-1
InitializrServiceTests.java
...amework/boot/cli/command/init/InitializrServiceTests.java
+1
-1
DependencyManagementArtifactCoordinatesResolverTests.java
...DependencyManagementArtifactCoordinatesResolverTests.java
+1
-1
GrapeRootRepositorySystemSessionAutoConfigurationTests.java
...apeRootRepositorySystemSessionAutoConfigurationTests.java
+2
-2
LocalDevToolsAutoConfigurationTests.java
...ls/autoconfigure/LocalDevToolsAutoConfigurationTests.java
+1
-1
RemoteClientConfigurationTests.java
...evtools/remote/client/RemoteClientConfigurationTests.java
+1
-1
DispatcherFilterTests.java
...rk/boot/devtools/remote/server/DispatcherFilterTests.java
+1
-1
DispatcherTests.java
...ramework/boot/devtools/remote/server/DispatcherTests.java
+1
-1
MockRestarter.java
.../springframework/boot/devtools/restart/MockRestarter.java
+2
-2
OnInitializedRestarterConditionTests.java
...evtools/restart/OnInitializedRestarterConditionTests.java
+1
-1
RestarterTests.java
...springframework/boot/devtools/restart/RestarterTests.java
+1
-1
TunnelClientTests.java
...mework/boot/devtools/tunnel/client/TunnelClientTests.java
+1
-1
HttpTunnelPayloadTests.java
.../boot/devtools/tunnel/payload/HttpTunnelPayloadTests.java
+1
-1
HttpTunnelServerTests.java
...rk/boot/devtools/tunnel/server/HttpTunnelServerTests.java
+1
-1
UserVehicleServiceTests.java
...rc/test/java/sample/test/web/UserVehicleServiceTests.java
+1
-1
SnakeTimerTests.java
...t/java/samples/websocket/jetty/snake/SnakeTimerTests.java
+1
-1
SnakeTimerTests.java
...java/samples/websocket/jetty93/snake/SnakeTimerTests.java
+1
-3
SnakeTimerTests.java
.../java/samples/websocket/tomcat/snake/SnakeTimerTests.java
+1
-1
SnakeTimerTests.java
...ava/samples/websocket/undertow/snake/SnakeTimerTests.java
+1
-1
MockBeanWithAopProxyTests.java
...ork/boot/test/mock/mockito/MockBeanWithAopProxyTests.java
+2
-2
MockitoTestExecutionListenerTests.java
.../test/mock/mockito/MockitoTestExecutionListenerTests.java
+2
-2
QualifierDefinitionTests.java
...work/boot/test/mock/mockito/QualifierDefinitionTests.java
+1
-1
SpyBeanWithAopProxyAndNotProxyTargetAwareTests.java
...ckito/SpyBeanWithAopProxyAndNotProxyTargetAwareTests.java
+2
-2
SpyBeanWithAopProxyTests.java
...work/boot/test/mock/mockito/SpyBeanWithAopProxyTests.java
+2
-2
RootUriRequestExpectationManagerTests.java
...est/web/client/RootUriRequestExpectationManagerTests.java
+1
-1
LocalHostWebClientTests.java
...ework/boot/test/web/htmlunit/LocalHostWebClientTests.java
+1
-1
RepackagerTests.java
...rg/springframework/boot/loader/tools/RepackagerTests.java
+2
-2
CentralDirectoryParserTests.java
...ramework/boot/loader/jar/CentralDirectoryParserTests.java
+3
-7
BannerTests.java
...t/src/test/java/org/springframework/boot/BannerTests.java
+2
-2
SpringApplicationBuilderTests.java
...framework/boot/builder/SpringApplicationBuilderTests.java
+1
-1
AbstractEmbeddedServletContainerFactoryTests.java
...mbedded/AbstractEmbeddedServletContainerFactoryTests.java
+2
-2
EmbeddedWebApplicationContextTests.java
.../context/embedded/EmbeddedWebApplicationContextTests.java
+7
-7
JettyEmbeddedServletContainerFactoryTests.java
...dded/jetty/JettyEmbeddedServletContainerFactoryTests.java
+1
-1
TomcatEmbeddedServletContainerFactoryTests.java
...ed/tomcat/TomcatEmbeddedServletContainerFactoryTests.java
+2
-2
UndertowEmbeddedServletContainerFactoryTests.java
...ndertow/UndertowEmbeddedServletContainerFactoryTests.java
+3
-3
FailureAnalyzersTests.java
...ringframework/boot/diagnostics/FailureAnalyzersTests.java
+1
-1
DataSourceXAResourceRecoveryHelperTests.java
...jta/narayana/DataSourceXAResourceRecoveryHelperTests.java
+1
-1
NarayanaXAConnectionFactoryWrapperTests.java
...jta/narayana/NarayanaXAConnectionFactoryWrapperTests.java
+1
-1
NarayanaXADataSourceWrapperTests.java
...k/boot/jta/narayana/NarayanaXADataSourceWrapperTests.java
+1
-1
Log4J2LoggingSystemTests.java
...amework/boot/logging/log4j2/Log4J2LoggingSystemTests.java
+1
-1
ConcurrentReferenceCachingMetadataReaderFactoryTests.java
...ConcurrentReferenceCachingMetadataReaderFactoryTests.java
+1
-1
RestTemplateBuilderTests.java
...ngframework/boot/web/client/RestTemplateBuilderTests.java
+1
-1
AbstractFilterRegistrationBeanTests.java
...boot/web/servlet/AbstractFilterRegistrationBeanTests.java
+4
-4
DelegatingFilterProxyRegistrationBeanTests.java
...b/servlet/DelegatingFilterProxyRegistrationBeanTests.java
+1
-1
FilterRegistrationBeanTests.java
...amework/boot/web/servlet/FilterRegistrationBeanTests.java
+1
-1
ServletListenerRegistrationBeanTests.java
...oot/web/servlet/ServletListenerRegistrationBeanTests.java
+1
-1
ServletRegistrationBeanTests.java
...mework/boot/web/servlet/ServletRegistrationBeanTests.java
+5
-6
No files found.
spring-boot-actuator/src/test/java/org/springframework/boot/actuate/autoconfigure/MetricExportAutoConfigurationTests.java
View file @
77f9bb09
...
...
@@ -47,7 +47,7 @@ import org.springframework.scheduling.annotation.SchedulingConfigurer;
import
org.springframework.test.util.ReflectionTestUtils
;
import
static
org
.
assertj
.
core
.
api
.
Assertions
.
assertThat
;
import
static
org
.
mockito
.
Matchers
.
any
;
import
static
org
.
mockito
.
Argument
Matchers
.
any
;
import
static
org
.
mockito
.
Mockito
.
atLeastOnce
;
import
static
org
.
mockito
.
Mockito
.
verify
;
...
...
spring-boot-actuator/src/test/java/org/springframework/boot/actuate/autoconfigure/MetricFilterAutoConfigurationTests.java
View file @
77f9bb09
...
...
@@ -58,11 +58,11 @@ import static org.hamcrest.Matchers.is;
import
static
org
.
hamcrest
.
Matchers
.
notNullValue
;
import
static
org
.
hamcrest
.
Matchers
.
nullValue
;
import
static
org
.
junit
.
Assert
.
fail
;
import
static
org
.
mockito
.
ArgumentMatchers
.
anyDouble
;
import
static
org
.
mockito
.
ArgumentMatchers
.
anyString
;
import
static
org
.
mockito
.
ArgumentMatchers
.
eq
;
import
static
org
.
mockito
.
BDDMockito
.
willAnswer
;
import
static
org
.
mockito
.
BDDMockito
.
willThrow
;
import
static
org
.
mockito
.
Matchers
.
anyDouble
;
import
static
org
.
mockito
.
Matchers
.
anyString
;
import
static
org
.
mockito
.
Matchers
.
eq
;
import
static
org
.
mockito
.
Mockito
.
mock
;
import
static
org
.
mockito
.
Mockito
.
never
;
import
static
org
.
mockito
.
Mockito
.
times
;
...
...
spring-boot-actuator/src/test/java/org/springframework/boot/actuate/health/ElasticsearchHealthIndicatorTests.java
View file @
77f9bb09
...
...
@@ -39,8 +39,8 @@ import org.mockito.Mock;
import
org.mockito.MockitoAnnotations
;
import
static
org
.
assertj
.
core
.
api
.
Assertions
.
assertThat
;
import
static
org
.
mockito
.
ArgumentMatchers
.
any
;
import
static
org
.
mockito
.
BDDMockito
.
given
;
import
static
org
.
mockito
.
Matchers
.
any
;
/**
* Test for {@link ElasticsearchHealthIndicator}.
...
...
spring-boot-actuator/src/test/java/org/springframework/boot/actuate/health/ElasticsearchJestHealthIndicatorTests.java
View file @
77f9bb09
...
...
@@ -28,8 +28,8 @@ import io.searchbox.core.SearchResult;
import
org.junit.Test
;
import
static
org
.
assertj
.
core
.
api
.
Assertions
.
assertThat
;
import
static
org
.
mockito
.
ArgumentMatchers
.
any
;
import
static
org
.
mockito
.
BDDMockito
.
given
;
import
static
org
.
mockito
.
Matchers
.
any
;
import
static
org
.
mockito
.
Mockito
.
mock
;
/**
...
...
spring-boot-actuator/src/test/java/org/springframework/boot/actuate/metrics/dropwizard/DropwizardMetricServicesTests.java
View file @
77f9bb09
...
...
@@ -32,8 +32,8 @@ import org.mockito.MockitoAnnotations;
import
org.springframework.test.util.ReflectionTestUtils
;
import
static
org
.
assertj
.
core
.
api
.
Assertions
.
assertThat
;
import
static
org
.
mockito
.
ArgumentMatchers
.
anyString
;
import
static
org
.
mockito
.
BDDMockito
.
given
;
import
static
org
.
mockito
.
Matchers
.
anyString
;
/**
* Tests for {@link DropwizardMetricServices}.
...
...
spring-boot-actuator/src/test/java/org/springframework/boot/actuate/metrics/opentsdb/OpenTsdbGaugeWriterTests.java
View file @
77f9bb09
...
...
@@ -27,9 +27,9 @@ import org.springframework.http.HttpStatus;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.web.client.RestOperations
;
import
static
org
.
mockito
.
ArgumentMatchers
.
any
;
import
static
org
.
mockito
.
ArgumentMatchers
.
anyString
;
import
static
org
.
mockito
.
BDDMockito
.
given
;
import
static
org
.
mockito
.
Matchers
.
any
;
import
static
org
.
mockito
.
Matchers
.
anyString
;
import
static
org
.
mockito
.
Mockito
.
mock
;
import
static
org
.
mockito
.
Mockito
.
verify
;
...
...
spring-boot-actuator/src/test/java/org/springframework/boot/actuate/security/AuthenticationAuditListenerTests.java
View file @
77f9bb09
...
...
@@ -34,7 +34,7 @@ import org.springframework.security.core.userdetails.User;
import
org.springframework.security.web.authentication.switchuser.AuthenticationSwitchUserEvent
;
import
static
org
.
assertj
.
core
.
api
.
Assertions
.
assertThat
;
import
static
org
.
mockito
.
Matchers
.
anyObject
;
import
static
org
.
mockito
.
ArgumentMatchers
.
any
;
import
static
org
.
mockito
.
Mockito
.
mock
;
import
static
org
.
mockito
.
Mockito
.
never
;
import
static
org
.
mockito
.
Mockito
.
verify
;
...
...
@@ -68,7 +68,7 @@ public class AuthenticationAuditListenerTests {
this
.
listener
.
onApplicationEvent
(
new
InteractiveAuthenticationSuccessEvent
(
new
UsernamePasswordAuthenticationToken
(
"user"
,
"password"
),
getClass
()));
// No need to audit this one (it shadows a regular AuthenticationSuccessEvent)
verify
(
this
.
publisher
,
never
()).
publishEvent
((
ApplicationEvent
)
any
Object
());
verify
(
this
.
publisher
,
never
()).
publishEvent
((
ApplicationEvent
)
any
());
}
@Test
...
...
spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/cache/support/MockCachingProvider.java
View file @
77f9bb09
...
...
@@ -30,9 +30,9 @@ import javax.cache.spi.CachingProvider;
import
org.mockito.invocation.InvocationOnMock
;
import
org.mockito.stubbing.Answer
;
import
static
org
.
mockito
.
ArgumentMatchers
.
any
;
import
static
org
.
mockito
.
ArgumentMatchers
.
anyString
;
import
static
org
.
mockito
.
BDDMockito
.
given
;
import
static
org
.
mockito
.
Matchers
.
any
;
import
static
org
.
mockito
.
Matchers
.
anyString
;
import
static
org
.
mockito
.
Mockito
.
mock
;
/**
...
...
spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/data/neo4j/Neo4jDataAutoConfigurationTests.java
View file @
77f9bb09
...
...
@@ -43,7 +43,7 @@ import org.springframework.data.neo4j.web.support.OpenSessionInViewInterceptor;
import
org.springframework.web.context.support.AnnotationConfigWebApplicationContext
;
import
static
org
.
assertj
.
core
.
api
.
Assertions
.
assertThat
;
import
static
org
.
mockito
.
Matchers
.
any
;
import
static
org
.
mockito
.
Argument
Matchers
.
any
;
import
static
org
.
mockito
.
Mockito
.
mock
;
import
static
org
.
mockito
.
Mockito
.
verify
;
...
...
spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/logging/AutoConfigurationReportLoggingInitializerTests.java
View file @
77f9bb09
...
...
@@ -47,9 +47,9 @@ import org.springframework.web.context.support.AnnotationConfigWebApplicationCon
import
static
org
.
assertj
.
core
.
api
.
Assertions
.
assertThat
;
import
static
org
.
junit
.
Assert
.
fail
;
import
static
org
.
mockito
.
ArgumentMatchers
.
any
;
import
static
org
.
mockito
.
BDDMockito
.
given
;
import
static
org
.
mockito
.
BDDMockito
.
willAnswer
;
import
static
org
.
mockito
.
Matchers
.
anyObject
;
import
static
org
.
mockito
.
Mockito
.
mock
;
/**
...
...
@@ -88,7 +88,7 @@ public class AutoConfigurationReportLoggingInitializerTests {
.
add
(
String
.
valueOf
(
invocation
.
getArguments
()[
0
]));
}
}).
given
(
this
.
log
).
debug
(
any
Object
());
}).
given
(
this
.
log
).
debug
(
any
());
given
(
this
.
log
.
isInfoEnabled
()).
willReturn
(
info
);
willAnswer
(
new
Answer
<
Object
>()
{
...
...
@@ -99,7 +99,7 @@ public class AutoConfigurationReportLoggingInitializerTests {
.
add
(
String
.
valueOf
(
invocation
.
getArguments
()[
0
]));
}
}).
given
(
this
.
log
).
info
(
any
Object
());
}).
given
(
this
.
log
).
info
(
any
());
LogFactory
.
releaseAll
();
System
.
setProperty
(
LogFactory
.
FACTORY_PROPERTY
,
MockLogFactory
.
class
.
getName
());
...
...
spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/security/oauth2/resource/UserInfoTokenServicesTests.java
View file @
77f9bb09
...
...
@@ -35,9 +35,9 @@ import org.springframework.security.oauth2.common.DefaultOAuth2AccessToken;
import
org.springframework.security.oauth2.common.exceptions.InvalidTokenException
;
import
static
org
.
assertj
.
core
.
api
.
Assertions
.
assertThat
;
import
static
org
.
mockito
.
ArgumentMatchers
.
any
;
import
static
org
.
mockito
.
ArgumentMatchers
.
eq
;
import
static
org
.
mockito
.
BDDMockito
.
given
;
import
static
org
.
mockito
.
Matchers
.
any
;
import
static
org
.
mockito
.
Matchers
.
eq
;
import
static
org
.
mockito
.
Mockito
.
mock
;
/**
...
...
spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/DefaultErrorViewResolverTests.java
View file @
77f9bb09
...
...
@@ -43,9 +43,9 @@ import org.springframework.mock.web.MockHttpServletResponse;
import
org.springframework.web.servlet.ModelAndView
;
import
static
org
.
assertj
.
core
.
api
.
Assertions
.
assertThat
;
import
static
org
.
mockito
.
ArgumentMatchers
.
any
;
import
static
org
.
mockito
.
ArgumentMatchers
.
eq
;
import
static
org
.
mockito
.
BDDMockito
.
given
;
import
static
org
.
mockito
.
Matchers
.
any
;
import
static
org
.
mockito
.
Matchers
.
eq
;
import
static
org
.
mockito
.
Mockito
.
mock
;
import
static
org
.
mockito
.
Mockito
.
verify
;
import
static
org
.
mockito
.
Mockito
.
verifyNoMoreInteractions
;
...
...
spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/EmbeddedServletContainerServletContextListenerTests.java
View file @
77f9bb09
...
...
@@ -31,7 +31,7 @@ import org.springframework.boot.web.servlet.ServletListenerRegistrationBean;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Configuration
;
import
static
org
.
mockito
.
Matchers
.
any
;
import
static
org
.
mockito
.
Argument
Matchers
.
any
;
import
static
org
.
mockito
.
Mockito
.
mock
;
import
static
org
.
mockito
.
Mockito
.
verify
;
...
...
spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/ServerPropertiesTests.java
View file @
77f9bb09
...
...
@@ -52,8 +52,8 @@ import org.springframework.boot.web.servlet.ServletContextInitializer;
import
org.springframework.mock.env.MockEnvironment
;
import
static
org
.
assertj
.
core
.
api
.
Assertions
.
assertThat
;
import
static
org
.
mockito
.
ArgumentMatchers
.
anyBoolean
;
import
static
org
.
mockito
.
BDDMockito
.
given
;
import
static
org
.
mockito
.
Matchers
.
anyBoolean
;
import
static
org
.
mockito
.
Mockito
.
atLeastOnce
;
import
static
org
.
mockito
.
Mockito
.
mock
;
import
static
org
.
mockito
.
Mockito
.
never
;
...
...
spring-boot-cli/src/test/java/org/springframework/boot/cli/command/init/InitializrServiceTests.java
View file @
77f9bb09
...
...
@@ -23,8 +23,8 @@ import org.junit.Test;
import
org.junit.rules.ExpectedException
;
import
static
org
.
assertj
.
core
.
api
.
Assertions
.
assertThat
;
import
static
org
.
mockito
.
ArgumentMatchers
.
isA
;
import
static
org
.
mockito
.
BDDMockito
.
given
;
import
static
org
.
mockito
.
Matchers
.
isA
;
import
static
org
.
mockito
.
Mockito
.
mock
;
/**
...
...
spring-boot-cli/src/test/java/org/springframework/boot/cli/compiler/dependencies/DependencyManagementArtifactCoordinatesResolverTests.java
View file @
77f9bb09
...
...
@@ -20,8 +20,8 @@ import org.junit.Before;
import
org.junit.Test
;
import
static
org
.
assertj
.
core
.
api
.
Assertions
.
assertThat
;
import
static
org
.
mockito
.
ArgumentMatchers
.
anyString
;
import
static
org
.
mockito
.
BDDMockito
.
given
;
import
static
org
.
mockito
.
Matchers
.
anyString
;
import
static
org
.
mockito
.
Mockito
.
mock
;
import
static
org
.
mockito
.
Mockito
.
never
;
import
static
org
.
mockito
.
Mockito
.
verify
;
...
...
spring-boot-cli/src/test/java/org/springframework/boot/cli/compiler/grape/GrapeRootRepositorySystemSessionAutoConfigurationTests.java
View file @
77f9bb09
...
...
@@ -32,9 +32,9 @@ import org.mockito.invocation.InvocationOnMock;
import
org.mockito.stubbing.Answer
;
import
static
org
.
assertj
.
core
.
api
.
Assertions
.
assertThat
;
import
static
org
.
mockito
.
ArgumentMatchers
.
any
;
import
static
org
.
mockito
.
ArgumentMatchers
.
eq
;
import
static
org
.
mockito
.
BDDMockito
.
given
;
import
static
org
.
mockito
.
Matchers
.
any
;
import
static
org
.
mockito
.
Matchers
.
eq
;
import
static
org
.
mockito
.
Mockito
.
times
;
import
static
org
.
mockito
.
Mockito
.
verify
;
...
...
spring-boot-devtools/src/test/java/org/springframework/boot/devtools/autoconfigure/LocalDevToolsAutoConfigurationTests.java
View file @
77f9bb09
...
...
@@ -58,7 +58,7 @@ import org.springframework.test.util.ReflectionTestUtils;
import
org.springframework.util.SocketUtils
;
import
static
org
.
assertj
.
core
.
api
.
Assertions
.
assertThat
;
import
static
org
.
mockito
.
Matchers
.
any
;
import
static
org
.
mockito
.
Argument
Matchers
.
any
;
import
static
org
.
mockito
.
Mockito
.
mock
;
import
static
org
.
mockito
.
Mockito
.
never
;
import
static
org
.
mockito
.
Mockito
.
reset
;
...
...
spring-boot-devtools/src/test/java/org/springframework/boot/devtools/remote/client/RemoteClientConfigurationTests.java
View file @
77f9bb09
...
...
@@ -50,8 +50,8 @@ import org.springframework.http.server.ServerHttpResponse;
import
org.springframework.util.SocketUtils
;
import
static
org
.
assertj
.
core
.
api
.
Assertions
.
assertThat
;
import
static
org
.
mockito
.
ArgumentMatchers
.
any
;
import
static
org
.
mockito
.
BDDMockito
.
given
;
import
static
org
.
mockito
.
Matchers
.
any
;
import
static
org
.
mockito
.
Mockito
.
mock
;
import
static
org
.
mockito
.
Mockito
.
verify
;
...
...
spring-boot-devtools/src/test/java/org/springframework/boot/devtools/remote/server/DispatcherFilterTests.java
View file @
77f9bb09
...
...
@@ -39,8 +39,8 @@ import org.springframework.mock.web.MockHttpServletRequest;
import
org.springframework.mock.web.MockHttpServletResponse
;
import
static
org
.
assertj
.
core
.
api
.
Assertions
.
assertThat
;
import
static
org
.
mockito
.
ArgumentMatchers
.
any
;
import
static
org
.
mockito
.
BDDMockito
.
willReturn
;
import
static
org
.
mockito
.
Matchers
.
any
;
import
static
org
.
mockito
.
Mockito
.
mock
;
import
static
org
.
mockito
.
Mockito
.
verify
;
import
static
org
.
mockito
.
Mockito
.
verifyZeroInteractions
;
...
...
spring-boot-devtools/src/test/java/org/springframework/boot/devtools/remote/server/DispatcherTests.java
View file @
77f9bb09
...
...
@@ -37,8 +37,8 @@ import org.springframework.mock.web.MockHttpServletRequest;
import
org.springframework.mock.web.MockHttpServletResponse
;
import
static
org
.
assertj
.
core
.
api
.
Assertions
.
assertThat
;
import
static
org
.
mockito
.
ArgumentMatchers
.
any
;
import
static
org
.
mockito
.
BDDMockito
.
given
;
import
static
org
.
mockito
.
Matchers
.
any
;
import
static
org
.
mockito
.
Mockito
.
inOrder
;
import
static
org
.
mockito
.
Mockito
.
mock
;
import
static
org
.
mockito
.
Mockito
.
verify
;
...
...
spring-boot-devtools/src/test/java/org/springframework/boot/devtools/restart/MockRestarter.java
View file @
77f9bb09
...
...
@@ -29,9 +29,9 @@ import org.mockito.stubbing.Answer;
import
org.springframework.beans.factory.ObjectFactory
;
import
static
org
.
mockito
.
ArgumentMatchers
.
any
;
import
static
org
.
mockito
.
ArgumentMatchers
.
anyString
;
import
static
org
.
mockito
.
BDDMockito
.
given
;
import
static
org
.
mockito
.
Matchers
.
any
;
import
static
org
.
mockito
.
Matchers
.
anyString
;
import
static
org
.
mockito
.
Mockito
.
mock
;
/**
...
...
spring-boot-devtools/src/test/java/org/springframework/boot/devtools/restart/OnInitializedRestarterConditionTests.java
View file @
77f9bb09
...
...
@@ -28,8 +28,8 @@ import org.springframework.context.annotation.Bean;
import
org.springframework.context.annotation.Configuration
;
import
static
org
.
assertj
.
core
.
api
.
Assertions
.
assertThat
;
import
static
org
.
mockito
.
ArgumentMatchers
.
any
;
import
static
org
.
mockito
.
BDDMockito
.
given
;
import
static
org
.
mockito
.
Matchers
.
any
;
import
static
org
.
mockito
.
Mockito
.
mock
;
/**
...
...
spring-boot-devtools/src/test/java/org/springframework/boot/devtools/restart/RestarterTests.java
View file @
77f9bb09
...
...
@@ -44,8 +44,8 @@ import org.springframework.util.FileCopyUtils;
import
org.springframework.util.StringUtils
;
import
static
org
.
assertj
.
core
.
api
.
Assertions
.
assertThat
;
import
static
org
.
mockito
.
ArgumentMatchers
.
any
;
import
static
org
.
mockito
.
BDDMockito
.
given
;
import
static
org
.
mockito
.
Matchers
.
any
;
import
static
org
.
mockito
.
Mockito
.
mock
;
import
static
org
.
mockito
.
Mockito
.
verifyZeroInteractions
;
...
...
spring-boot-devtools/src/test/java/org/springframework/boot/devtools/tunnel/client/TunnelClientTests.java
View file @
77f9bb09
...
...
@@ -32,7 +32,7 @@ import org.junit.rules.ExpectedException;
import
org.springframework.util.SocketUtils
;
import
static
org
.
assertj
.
core
.
api
.
Assertions
.
assertThat
;
import
static
org
.
mockito
.
Matchers
.
any
;
import
static
org
.
mockito
.
Argument
Matchers
.
any
;
import
static
org
.
mockito
.
Mockito
.
mock
;
import
static
org
.
mockito
.
Mockito
.
verify
;
...
...
spring-boot-devtools/src/test/java/org/springframework/boot/devtools/tunnel/payload/HttpTunnelPayloadTests.java
View file @
77f9bb09
...
...
@@ -37,8 +37,8 @@ import org.springframework.mock.web.MockHttpServletRequest;
import
org.springframework.mock.web.MockHttpServletResponse
;
import
static
org
.
assertj
.
core
.
api
.
Assertions
.
assertThat
;
import
static
org
.
mockito
.
ArgumentMatchers
.
any
;
import
static
org
.
mockito
.
BDDMockito
.
given
;
import
static
org
.
mockito
.
Matchers
.
any
;
import
static
org
.
mockito
.
Mockito
.
mock
;
/**
...
...
spring-boot-devtools/src/test/java/org/springframework/boot/devtools/tunnel/server/HttpTunnelServerTests.java
View file @
77f9bb09
...
...
@@ -48,8 +48,8 @@ import org.springframework.mock.web.MockHttpServletRequest;
import
org.springframework.mock.web.MockHttpServletResponse
;
import
static
org
.
assertj
.
core
.
api
.
Assertions
.
assertThat
;
import
static
org
.
mockito
.
ArgumentMatchers
.
anyInt
;
import
static
org
.
mockito
.
BDDMockito
.
given
;
import
static
org
.
mockito
.
Matchers
.
anyInt
;
import
static
org
.
mockito
.
Mockito
.
mock
;
import
static
org
.
mockito
.
Mockito
.
never
;
import
static
org
.
mockito
.
Mockito
.
times
;
...
...
spring-boot-samples/spring-boot-sample-test/src/test/java/sample/test/web/UserVehicleServiceTests.java
View file @
77f9bb09
...
...
@@ -29,8 +29,8 @@ import sample.test.service.VehicleDetails;
import
sample.test.service.VehicleDetailsService
;
import
static
org
.
assertj
.
core
.
api
.
Assertions
.
assertThat
;
import
static
org
.
mockito
.
ArgumentMatchers
.
anyString
;
import
static
org
.
mockito
.
BDDMockito
.
given
;
import
static
org
.
mockito
.
Matchers
.
anyString
;
/**
* Tests for {@link UserVehicleService}.
...
...
spring-boot-samples/spring-boot-sample-websocket-jetty/src/test/java/samples/websocket/jetty/snake/SnakeTimerTests.java
View file @
77f9bb09
...
...
@@ -21,8 +21,8 @@ import java.io.IOException;
import
org.junit.Test
;
import
static
org
.
assertj
.
core
.
api
.
Assertions
.
assertThat
;
import
static
org
.
mockito
.
ArgumentMatchers
.
anyString
;
import
static
org
.
mockito
.
BDDMockito
.
willThrow
;
import
static
org
.
mockito
.
Matchers
.
anyString
;
import
static
org
.
mockito
.
Mockito
.
mock
;
public
class
SnakeTimerTests
{
...
...
spring-boot-samples/spring-boot-sample-websocket-jetty93/src/test/java/samples/websocket/jetty93/snake/SnakeTimerTests.java
View file @
77f9bb09
...
...
@@ -19,12 +19,10 @@ package samples.websocket.jetty93.snake;
import
java.io.IOException
;
import
org.junit.Test
;
import
samples.websocket.jetty93.snake.Snake
;
import
samples.websocket.jetty93.snake.SnakeTimer
;
import
static
org
.
assertj
.
core
.
api
.
Assertions
.
assertThat
;
import
static
org
.
mockito
.
ArgumentMatchers
.
anyString
;
import
static
org
.
mockito
.
BDDMockito
.
willThrow
;
import
static
org
.
mockito
.
Matchers
.
anyString
;
import
static
org
.
mockito
.
Mockito
.
mock
;
public
class
SnakeTimerTests
{
...
...
spring-boot-samples/spring-boot-sample-websocket-tomcat/src/test/java/samples/websocket/tomcat/snake/SnakeTimerTests.java
View file @
77f9bb09
...
...
@@ -21,8 +21,8 @@ import java.io.IOException;
import
org.junit.Test
;
import
static
org
.
assertj
.
core
.
api
.
Assertions
.
assertThat
;
import
static
org
.
mockito
.
ArgumentMatchers
.
anyString
;
import
static
org
.
mockito
.
BDDMockito
.
willThrow
;
import
static
org
.
mockito
.
Matchers
.
anyString
;
import
static
org
.
mockito
.
Mockito
.
mock
;
public
class
SnakeTimerTests
{
...
...
spring-boot-samples/spring-boot-sample-websocket-undertow/src/test/java/samples/websocket/undertow/snake/SnakeTimerTests.java
View file @
77f9bb09
...
...
@@ -21,8 +21,8 @@ import java.io.IOException;
import
org.junit.Test
;
import
static
org
.
assertj
.
core
.
api
.
Assertions
.
assertThat
;
import
static
org
.
mockito
.
ArgumentMatchers
.
anyString
;
import
static
org
.
mockito
.
BDDMockito
.
willThrow
;
import
static
org
.
mockito
.
Matchers
.
anyString
;
import
static
org
.
mockito
.
Mockito
.
mock
;
public
class
SnakeTimerTests
{
...
...
spring-boot-test/src/test/java/org/springframework/boot/test/mock/mockito/MockBeanWithAopProxyTests.java
View file @
77f9bb09
...
...
@@ -34,9 +34,9 @@ import org.springframework.stereotype.Service;
import
org.springframework.test.context.junit4.SpringRunner
;
import
static
org
.
assertj
.
core
.
api
.
Assertions
.
assertThat
;
import
static
org
.
mockito
.
ArgumentMatchers
.
anyBoolean
;
import
static
org
.
mockito
.
ArgumentMatchers
.
eq
;
import
static
org
.
mockito
.
BDDMockito
.
given
;
import
static
org
.
mockito
.
Matchers
.
anyBoolean
;
import
static
org
.
mockito
.
Matchers
.
eq
;
import
static
org
.
mockito
.
Mockito
.
times
;
import
static
org
.
mockito
.
Mockito
.
verify
;
...
...
spring-boot-test/src/test/java/org/springframework/boot/test/mock/mockito/MockitoTestExecutionListenerTests.java
View file @
77f9bb09
...
...
@@ -30,9 +30,9 @@ import org.springframework.context.ApplicationContext;
import
org.springframework.test.context.TestContext
;
import
static
org
.
assertj
.
core
.
api
.
Assertions
.
assertThat
;
import
static
org
.
mockito
.
ArgumentMatchers
.
any
;
import
static
org
.
mockito
.
ArgumentMatchers
.
eq
;
import
static
org
.
mockito
.
BDDMockito
.
given
;
import
static
org
.
mockito
.
Matchers
.
any
;
import
static
org
.
mockito
.
Matchers
.
eq
;
import
static
org
.
mockito
.
Mockito
.
mock
;
import
static
org
.
mockito
.
Mockito
.
verify
;
...
...
spring-boot-test/src/test/java/org/springframework/boot/test/mock/mockito/QualifierDefinitionTests.java
View file @
77f9bb09
...
...
@@ -35,7 +35,7 @@ import org.springframework.context.annotation.Configuration;
import
org.springframework.util.ReflectionUtils
;
import
static
org
.
assertj
.
core
.
api
.
Assertions
.
assertThat
;
import
static
org
.
mockito
.
Matchers
.
eq
;
import
static
org
.
mockito
.
Argument
Matchers
.
eq
;
import
static
org
.
mockito
.
Mockito
.
verify
;
/**
...
...
spring-boot-test/src/test/java/org/springframework/boot/test/mock/mockito/SpyBeanWithAopProxyAndNotProxyTargetAwareTests.java
View file @
77f9bb09
...
...
@@ -34,8 +34,8 @@ import org.springframework.context.annotation.Import;
import
org.springframework.stereotype.Service
;
import
org.springframework.test.context.junit4.SpringRunner
;
import
static
org
.
mockito
.
Matchers
.
anyBoolean
;
import
static
org
.
mockito
.
Matchers
.
eq
;
import
static
org
.
mockito
.
Argument
Matchers
.
anyBoolean
;
import
static
org
.
mockito
.
Argument
Matchers
.
eq
;
import
static
org
.
mockito
.
Mockito
.
reset
;
import
static
org
.
mockito
.
Mockito
.
times
;
import
static
org
.
mockito
.
Mockito
.
verify
;
...
...
spring-boot-test/src/test/java/org/springframework/boot/test/mock/mockito/SpyBeanWithAopProxyTests.java
View file @
77f9bb09
...
...
@@ -34,8 +34,8 @@ import org.springframework.stereotype.Service;
import
org.springframework.test.context.junit4.SpringRunner
;
import
static
org
.
assertj
.
core
.
api
.
Assertions
.
assertThat
;
import
static
org
.
mockito
.
Matchers
.
anyBoolean
;
import
static
org
.
mockito
.
Matchers
.
eq
;
import
static
org
.
mockito
.
Argument
Matchers
.
anyBoolean
;
import
static
org
.
mockito
.
Argument
Matchers
.
eq
;
import
static
org
.
mockito
.
Mockito
.
times
;
import
static
org
.
mockito
.
Mockito
.
verify
;
...
...
spring-boot-test/src/test/java/org/springframework/boot/test/web/client/RootUriRequestExpectationManagerTests.java
View file @
77f9bb09
...
...
@@ -37,8 +37,8 @@ import org.springframework.test.web.client.RequestMatcher;
import
org.springframework.web.client.RestTemplate
;
import
static
org
.
assertj
.
core
.
api
.
Assertions
.
assertThat
;
import
static
org
.
mockito
.
ArgumentMatchers
.
any
;
import
static
org
.
mockito
.
BDDMockito
.
given
;
import
static
org
.
mockito
.
Matchers
.
any
;
import
static
org
.
mockito
.
Mockito
.
mock
;
import
static
org
.
mockito
.
Mockito
.
verify
;
import
static
org
.
springframework
.
test
.
web
.
client
.
match
.
MockRestRequestMatchers
.
requestTo
;
...
...
spring-boot-test/src/test/java/org/springframework/boot/test/web/htmlunit/LocalHostWebClientTests.java
View file @
77f9bb09
...
...
@@ -35,8 +35,8 @@ import org.mockito.MockitoAnnotations;
import
org.springframework.mock.env.MockEnvironment
;
import
static
org
.
assertj
.
core
.
api
.
Assertions
.
assertThat
;
import
static
org
.
mockito
.
ArgumentMatchers
.
any
;
import
static
org
.
mockito
.
BDDMockito
.
given
;
import
static
org
.
mockito
.
Matchers
.
any
;
import
static
org
.
mockito
.
Mockito
.
mock
;
import
static
org
.
mockito
.
Mockito
.
verify
;
...
...
spring-boot-tools/spring-boot-loader-tools/src/test/java/org/springframework/boot/loader/tools/RepackagerTests.java
View file @
77f9bb09
...
...
@@ -40,9 +40,9 @@ import org.springframework.boot.loader.tools.sample.ClassWithoutMainMethod;
import
org.springframework.util.FileCopyUtils
;
import
static
org
.
assertj
.
core
.
api
.
Assertions
.
assertThat
;
import
static
org
.
mockito
.
ArgumentMatchers
.
anyString
;
import
static
org
.
mockito
.
ArgumentMatchers
.
eq
;
import
static
org
.
mockito
.
BDDMockito
.
given
;
import
static
org
.
mockito
.
Matchers
.
anyString
;
import
static
org
.
mockito
.
Matchers
.
eq
;
import
static
org
.
mockito
.
Mockito
.
mock
;
/**
...
...
spring-boot-tools/spring-boot-loader/src/test/java/org/springframework/boot/loader/jar/CentralDirectoryParserTests.java
View file @
77f9bb09
...
...
@@ -32,8 +32,8 @@ import org.springframework.boot.loader.data.RandomAccessData;
import
org.springframework.boot.loader.data.RandomAccessDataFile
;
import
static
org
.
assertj
.
core
.
api
.
Assertions
.
assertThat
;
import
static
org
.
mockito
.
Matchers
.
any
;
import
static
org
.
mockito
.
Matchers
.
anyInt
;
import
static
org
.
mockito
.
Argument
Matchers
.
any
;
import
static
org
.
mockito
.
Argument
Matchers
.
anyInt
;
import
static
org
.
mockito
.
Mockito
.
atLeastOnce
;
import
static
org
.
mockito
.
Mockito
.
inOrder
;
import
static
org
.
mockito
.
Mockito
.
mock
;
...
...
@@ -61,7 +61,7 @@ public class CentralDirectoryParserTests {
@Test
public
void
visitsInOrder
()
throws
Exception
{
CentralDirectoryVisitor
visitor
=
mock
(
Test
CentralDirectoryVisitor
.
class
);
CentralDirectoryVisitor
visitor
=
mock
(
CentralDirectoryVisitor
.
class
);
CentralDirectoryParser
parser
=
new
CentralDirectoryParser
();
parser
.
addVisitor
(
visitor
);
parser
.
parse
(
this
.
jarData
,
false
);
...
...
@@ -118,8 +118,4 @@ public class CentralDirectoryParserTests {
}
public
interface
TestCentralDirectoryVisitor
extends
CentralDirectoryVisitor
{
}
}
spring-boot/src/test/java/org/springframework/boot/BannerTests.java
View file @
77f9bb09
...
...
@@ -34,8 +34,8 @@ import org.springframework.core.env.Environment;
import
org.springframework.test.util.ReflectionTestUtils
;
import
static
org
.
assertj
.
core
.
api
.
Assertions
.
assertThat
;
import
static
org
.
mockito
.
Matchers
.
any
;
import
static
org
.
mockito
.
Matchers
.
eq
;
import
static
org
.
mockito
.
Argument
Matchers
.
any
;
import
static
org
.
mockito
.
Argument
Matchers
.
eq
;
import
static
org
.
mockito
.
Mockito
.
mock
;
import
static
org
.
mockito
.
Mockito
.
reset
;
import
static
org
.
mockito
.
Mockito
.
verify
;
...
...
spring-boot/src/test/java/org/springframework/boot/builder/SpringApplicationBuilderTests.java
View file @
77f9bb09
...
...
@@ -37,7 +37,7 @@ import org.springframework.core.io.ResourceLoader;
import
org.springframework.util.StringUtils
;
import
static
org
.
assertj
.
core
.
api
.
Assertions
.
assertThat
;
import
static
org
.
mockito
.
Matchers
.
any
;
import
static
org
.
mockito
.
Argument
Matchers
.
any
;
import
static
org
.
mockito
.
Mockito
.
spy
;
import
static
org
.
mockito
.
Mockito
.
verify
;
...
...
spring-boot/src/test/java/org/springframework/boot/context/embedded/AbstractEmbeddedServletContainerFactoryTests.java
View file @
77f9bb09
...
...
@@ -103,8 +103,8 @@ import org.springframework.util.concurrent.ListenableFuture;
import
static
org
.
assertj
.
core
.
api
.
Assertions
.
assertThat
;
import
static
org
.
hamcrest
.
CoreMatchers
.
notNullValue
;
import
static
org
.
junit
.
Assert
.
fail
;
import
static
org
.
mockito
.
ArgumentMatchers
.
any
;
import
static
org
.
mockito
.
BDDMockito
.
given
;
import
static
org
.
mockito
.
Matchers
.
anyObject
;
import
static
org
.
mockito
.
Mockito
.
inOrder
;
import
static
org
.
mockito
.
Mockito
.
mock
;
import
static
org
.
mockito
.
Mockito
.
verify
;
...
...
@@ -322,7 +322,7 @@ public abstract class AbstractEmbeddedServletContainerFactoryTests {
this
.
container
.
start
();
InOrder
ordered
=
inOrder
((
Object
[])
initializers
);
for
(
ServletContextInitializer
initializer
:
initializers
)
{
ordered
.
verify
(
initializer
).
onStartup
((
ServletContext
)
any
Object
());
ordered
.
verify
(
initializer
).
onStartup
((
ServletContext
)
any
());
}
}
...
...
spring-boot/src/test/java/org/springframework/boot/context/embedded/EmbeddedWebApplicationContextTests.java
View file @
77f9bb09
...
...
@@ -69,9 +69,9 @@ import org.springframework.web.context.request.SessionScope;
import
org.springframework.web.filter.GenericFilterBean
;
import
static
org
.
assertj
.
core
.
api
.
Assertions
.
assertThat
;
import
static
org
.
mockito
.
ArgumentMatchers
.
any
;
import
static
org
.
mockito
.
ArgumentMatchers
.
anyString
;
import
static
org
.
mockito
.
BDDMockito
.
given
;
import
static
org
.
mockito
.
Matchers
.
anyObject
;
import
static
org
.
mockito
.
Matchers
.
anyString
;
import
static
org
.
mockito
.
Mockito
.
atMost
;
import
static
org
.
mockito
.
Mockito
.
inOrder
;
import
static
org
.
mockito
.
Mockito
.
mock
;
...
...
@@ -381,8 +381,8 @@ public class EmbeddedWebApplicationContextTests {
ServletContext
servletContext
=
getEmbeddedServletContainerFactory
()
.
getServletContext
();
verify
(
initializer
).
onStartup
(
servletContext
);
verify
(
servletContext
).
addServlet
(
anyString
(),
(
Servlet
)
any
Object
());
verify
(
servletContext
).
addFilter
(
anyString
(),
(
Filter
)
any
Object
());
verify
(
servletContext
).
addServlet
(
anyString
(),
(
Servlet
)
any
());
verify
(
servletContext
).
addFilter
(
anyString
(),
(
Filter
)
any
());
}
@Test
...
...
@@ -400,8 +400,8 @@ public class EmbeddedWebApplicationContextTests {
this
.
context
.
refresh
();
ServletContext
servletContext
=
getEmbeddedServletContainerFactory
()
.
getServletContext
();
verify
(
servletContext
,
atMost
(
1
)).
addServlet
(
anyString
(),
(
Servlet
)
any
Object
());
verify
(
servletContext
,
atMost
(
1
)).
addFilter
(
anyString
(),
(
Filter
)
any
Object
());
verify
(
servletContext
,
atMost
(
1
)).
addServlet
(
anyString
(),
(
Servlet
)
any
());
verify
(
servletContext
,
atMost
(
1
)).
addFilter
(
anyString
(),
(
Filter
)
any
());
}
@Test
...
...
@@ -415,7 +415,7 @@ public class EmbeddedWebApplicationContextTests {
this
.
context
.
refresh
();
ServletContext
servletContext
=
getEmbeddedServletContainerFactory
()
.
getServletContext
();
verify
(
servletContext
,
atMost
(
1
)).
addFilter
(
anyString
(),
(
Filter
)
any
Object
());
verify
(
servletContext
,
atMost
(
1
)).
addFilter
(
anyString
(),
(
Filter
)
any
());
}
@Test
...
...
spring-boot/src/test/java/org/springframework/boot/context/embedded/jetty/JettyEmbeddedServletContainerFactoryTests.java
View file @
77f9bb09
...
...
@@ -51,7 +51,7 @@ import org.springframework.boot.web.servlet.ServletRegistrationBean;
import
org.springframework.http.HttpHeaders
;
import
static
org
.
assertj
.
core
.
api
.
Assertions
.
assertThat
;
import
static
org
.
mockito
.
Matchers
.
anyObject
;
import
static
org
.
mockito
.
Argument
Matchers
.
anyObject
;
import
static
org
.
mockito
.
Mockito
.
inOrder
;
import
static
org
.
mockito
.
Mockito
.
mock
;
...
...
spring-boot/src/test/java/org/springframework/boot/context/embedded/tomcat/TomcatEmbeddedServletContainerFactoryTests.java
View file @
77f9bb09
...
...
@@ -58,9 +58,9 @@ import org.springframework.util.SocketUtils;
import
static
org
.
assertj
.
core
.
api
.
Assertions
.
assertThat
;
import
static
org
.
junit
.
Assert
.
fail
;
import
static
org
.
mockito
.
ArgumentMatchers
.
any
;
import
static
org
.
mockito
.
ArgumentMatchers
.
anyObject
;
import
static
org
.
mockito
.
BDDMockito
.
given
;
import
static
org
.
mockito
.
Matchers
.
any
;
import
static
org
.
mockito
.
Matchers
.
anyObject
;
import
static
org
.
mockito
.
Mockito
.
inOrder
;
import
static
org
.
mockito
.
Mockito
.
mock
;
import
static
org
.
mockito
.
Mockito
.
verify
;
...
...
spring-boot/src/test/java/org/springframework/boot/context/embedded/undertow/UndertowEmbeddedServletContainerFactoryTests.java
View file @
77f9bb09
...
...
@@ -49,7 +49,7 @@ import org.springframework.http.HttpStatus;
import
org.springframework.test.util.ReflectionTestUtils
;
import
static
org
.
assertj
.
core
.
api
.
Assertions
.
assertThat
;
import
static
org
.
mockito
.
Matchers
.
anyObject
;
import
static
org
.
mockito
.
ArgumentMatchers
.
any
;
import
static
org
.
mockito
.
Mockito
.
inOrder
;
import
static
org
.
mockito
.
Mockito
.
mock
;
...
...
@@ -107,7 +107,7 @@ public class UndertowEmbeddedServletContainerFactoryTests
this
.
container
=
factory
.
getEmbeddedServletContainer
();
InOrder
ordered
=
inOrder
((
Object
[])
customizers
);
for
(
UndertowBuilderCustomizer
customizer
:
customizers
)
{
ordered
.
verify
(
customizer
).
customize
((
Builder
)
any
Object
());
ordered
.
verify
(
customizer
).
customize
((
Builder
)
any
());
}
}
...
...
@@ -140,7 +140,7 @@ public class UndertowEmbeddedServletContainerFactoryTests
this
.
container
=
factory
.
getEmbeddedServletContainer
();
InOrder
ordered
=
inOrder
((
Object
[])
customizers
);
for
(
UndertowDeploymentInfoCustomizer
customizer
:
customizers
)
{
ordered
.
verify
(
customizer
).
customize
((
DeploymentInfo
)
any
Object
());
ordered
.
verify
(
customizer
).
customize
((
DeploymentInfo
)
any
());
}
}
...
...
spring-boot/src/test/java/org/springframework/boot/diagnostics/FailureAnalyzersTests.java
View file @
77f9bb09
...
...
@@ -28,7 +28,7 @@ import org.springframework.beans.factory.BeanFactory;
import
org.springframework.beans.factory.BeanFactoryAware
;
import
org.springframework.context.annotation.AnnotationConfigApplicationContext
;
import
static
org
.
mockito
.
Matchers
.
any
;
import
static
org
.
mockito
.
Argument
Matchers
.
any
;
import
static
org
.
mockito
.
Mockito
.
mock
;
import
static
org
.
mockito
.
Mockito
.
times
;
import
static
org
.
mockito
.
Mockito
.
verify
;
...
...
spring-boot/src/test/java/org/springframework/boot/jta/narayana/DataSourceXAResourceRecoveryHelperTests.java
View file @
77f9bb09
...
...
@@ -27,8 +27,8 @@ import org.junit.Before;
import
org.junit.Test
;
import
static
org
.
assertj
.
core
.
api
.
Assertions
.
assertThat
;
import
static
org
.
mockito
.
ArgumentMatchers
.
anyString
;
import
static
org
.
mockito
.
BDDMockito
.
given
;
import
static
org
.
mockito
.
Matchers
.
anyString
;
import
static
org
.
mockito
.
Mockito
.
mock
;
import
static
org
.
mockito
.
Mockito
.
times
;
import
static
org
.
mockito
.
Mockito
.
verify
;
...
...
spring-boot/src/test/java/org/springframework/boot/jta/narayana/NarayanaXAConnectionFactoryWrapperTests.java
View file @
77f9bb09
...
...
@@ -25,8 +25,8 @@ import org.jboss.narayana.jta.jms.JmsXAResourceRecoveryHelper;
import
org.junit.Test
;
import
static
org
.
assertj
.
core
.
api
.
Assertions
.
assertThat
;
import
static
org
.
mockito
.
ArgumentMatchers
.
any
;
import
static
org
.
mockito
.
BDDMockito
.
given
;
import
static
org
.
mockito
.
Matchers
.
any
;
import
static
org
.
mockito
.
Mockito
.
mock
;
import
static
org
.
mockito
.
Mockito
.
times
;
import
static
org
.
mockito
.
Mockito
.
verify
;
...
...
spring-boot/src/test/java/org/springframework/boot/jta/narayana/NarayanaXADataSourceWrapperTests.java
View file @
77f9bb09
...
...
@@ -22,8 +22,8 @@ import javax.sql.XADataSource;
import
org.junit.Test
;
import
static
org
.
assertj
.
core
.
api
.
Assertions
.
assertThat
;
import
static
org
.
mockito
.
ArgumentMatchers
.
any
;
import
static
org
.
mockito
.
BDDMockito
.
given
;
import
static
org
.
mockito
.
Matchers
.
any
;
import
static
org
.
mockito
.
Mockito
.
mock
;
import
static
org
.
mockito
.
Mockito
.
times
;
import
static
org
.
mockito
.
Mockito
.
verify
;
...
...
spring-boot/src/test/java/org/springframework/boot/logging/log4j2/Log4J2LoggingSystemTests.java
View file @
77f9bb09
...
...
@@ -49,7 +49,7 @@ import org.springframework.util.StringUtils;
import
static
org
.
assertj
.
core
.
api
.
Assertions
.
assertThat
;
import
static
org
.
hamcrest
.
Matchers
.
containsString
;
import
static
org
.
hamcrest
.
Matchers
.
not
;
import
static
org
.
mockito
.
Matchers
.
any
;
import
static
org
.
mockito
.
Argument
Matchers
.
any
;
import
static
org
.
mockito
.
Mockito
.
mock
;
import
static
org
.
mockito
.
Mockito
.
times
;
import
static
org
.
mockito
.
Mockito
.
verify
;
...
...
spring-boot/src/test/java/org/springframework/boot/type/classreading/ConcurrentReferenceCachingMetadataReaderFactoryTests.java
View file @
77f9bb09
...
...
@@ -25,7 +25,7 @@ import org.springframework.core.type.classreading.MetadataReader;
import
static
org
.
assertj
.
core
.
api
.
Assertions
.
assertThat
;
import
static
org
.
hamcrest
.
Matchers
.
sameInstance
;
import
static
org
.
mockito
.
Matchers
.
any
;
import
static
org
.
mockito
.
Argument
Matchers
.
any
;
import
static
org
.
mockito
.
Mockito
.
mock
;
import
static
org
.
mockito
.
Mockito
.
spy
;
import
static
org
.
mockito
.
Mockito
.
times
;
...
...
spring-boot/src/test/java/org/springframework/boot/web/client/RestTemplateBuilderTests.java
View file @
77f9bb09
...
...
@@ -46,7 +46,7 @@ import org.springframework.web.client.RestTemplate;
import
org.springframework.web.util.UriTemplateHandler
;
import
static
org
.
assertj
.
core
.
api
.
Assertions
.
assertThat
;
import
static
org
.
mockito
.
Matchers
.
any
;
import
static
org
.
mockito
.
Argument
Matchers
.
any
;
import
static
org
.
mockito
.
Mockito
.
mock
;
import
static
org
.
mockito
.
Mockito
.
spy
;
import
static
org
.
mockito
.
Mockito
.
verify
;
...
...
spring-boot/src/test/java/org/springframework/boot/web/servlet/AbstractFilterRegistrationBeanTests.java
View file @
77f9bb09
...
...
@@ -35,10 +35,10 @@ import org.junit.rules.ExpectedException;
import
org.mockito.Mock
;
import
org.mockito.MockitoAnnotations
;
import
static
org
.
mockito
.
ArgumentMatchers
.
any
;
import
static
org
.
mockito
.
ArgumentMatchers
.
anyString
;
import
static
org
.
mockito
.
ArgumentMatchers
.
eq
;
import
static
org
.
mockito
.
BDDMockito
.
given
;
import
static
org
.
mockito
.
Matchers
.
anyObject
;
import
static
org
.
mockito
.
Matchers
.
anyString
;
import
static
org
.
mockito
.
Matchers
.
eq
;
import
static
org
.
mockito
.
Mockito
.
times
;
import
static
org
.
mockito
.
Mockito
.
verify
;
...
...
@@ -68,7 +68,7 @@ public abstract class AbstractFilterRegistrationBeanTests {
@Before
public
void
setupMocks
()
{
MockitoAnnotations
.
initMocks
(
this
);
given
(
this
.
servletContext
.
addFilter
(
anyString
(),
(
Filter
)
any
Object
()))
given
(
this
.
servletContext
.
addFilter
(
anyString
(),
(
Filter
)
any
()))
.
willReturn
(
this
.
registration
);
}
...
...
spring-boot/src/test/java/org/springframework/boot/web/servlet/DelegatingFilterProxyRegistrationBeanTests.java
View file @
77f9bb09
...
...
@@ -38,7 +38,7 @@ import org.springframework.web.filter.DelegatingFilterProxy;
import
org.springframework.web.filter.GenericFilterBean
;
import
static
org
.
assertj
.
core
.
api
.
Assertions
.
assertThat
;
import
static
org
.
mockito
.
Matchers
.
isA
;
import
static
org
.
mockito
.
Argument
Matchers
.
isA
;
/**
* Tests for {@link DelegatingFilterProxyRegistrationBean}.
...
...
spring-boot/src/test/java/org/springframework/boot/web/servlet/FilterRegistrationBeanTests.java
View file @
77f9bb09
...
...
@@ -22,7 +22,7 @@ import org.junit.Test;
import
org.springframework.boot.testutil.MockFilter
;
import
static
org
.
mockito
.
Matchers
.
eq
;
import
static
org
.
mockito
.
Argument
Matchers
.
eq
;
import
static
org
.
mockito
.
Mockito
.
verify
;
/**
...
...
spring-boot/src/test/java/org/springframework/boot/web/servlet/ServletListenerRegistrationBeanTests.java
View file @
77f9bb09
...
...
@@ -28,7 +28,7 @@ import org.junit.rules.ExpectedException;
import
org.mockito.Mock
;
import
org.mockito.MockitoAnnotations
;
import
static
org
.
mockito
.
Matchers
.
any
;
import
static
org
.
mockito
.
Argument
Matchers
.
any
;
import
static
org
.
mockito
.
Mockito
.
times
;
import
static
org
.
mockito
.
Mockito
.
verify
;
...
...
spring-boot/src/test/java/org/springframework/boot/web/servlet/ServletRegistrationBeanTests.java
View file @
77f9bb09
...
...
@@ -37,10 +37,9 @@ import org.mockito.MockitoAnnotations;
import
org.springframework.boot.testutil.MockServlet
;
import
static
org
.
mockito
.
ArgumentMatchers
.
any
;
import
static
org
.
mockito
.
ArgumentMatchers
.
anyString
;
import
static
org
.
mockito
.
BDDMockito
.
given
;
import
static
org
.
mockito
.
Matchers
.
any
;
import
static
org
.
mockito
.
Matchers
.
anyObject
;
import
static
org
.
mockito
.
Matchers
.
anyString
;
import
static
org
.
mockito
.
Mockito
.
never
;
import
static
org
.
mockito
.
Mockito
.
times
;
import
static
org
.
mockito
.
Mockito
.
verify
;
...
...
@@ -69,9 +68,9 @@ public class ServletRegistrationBeanTests {
@Before
public
void
setupMocks
()
{
MockitoAnnotations
.
initMocks
(
this
);
given
(
this
.
servletContext
.
addServlet
(
anyString
(),
(
Servlet
)
any
Object
()))
given
(
this
.
servletContext
.
addServlet
(
anyString
(),
(
Servlet
)
any
()))
.
willReturn
(
this
.
registration
);
given
(
this
.
servletContext
.
addFilter
(
anyString
(),
(
Filter
)
any
Object
()))
given
(
this
.
servletContext
.
addFilter
(
anyString
(),
(
Filter
)
any
()))
.
willReturn
(
this
.
filterRegistration
);
}
...
...
@@ -87,7 +86,7 @@ public class ServletRegistrationBeanTests {
@Test
public
void
startupWithDoubleRegistration
()
throws
Exception
{
ServletRegistrationBean
bean
=
new
ServletRegistrationBean
(
this
.
servlet
);
given
(
this
.
servletContext
.
addServlet
(
anyString
(),
(
Servlet
)
any
Object
()))
given
(
this
.
servletContext
.
addServlet
(
anyString
(),
(
Servlet
)
any
()))
.
willReturn
(
null
);
bean
.
onStartup
(
this
.
servletContext
);
verify
(
this
.
servletContext
).
addServlet
(
"mockServlet"
,
this
.
servlet
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment