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
ef9f1d39
Commit
ef9f1d39
authored
Mar 21, 2020
by
dreis2211
Committed by
Stephane Nicoll
Mar 22, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove redundant MockitoAnnotations.initMocks()
See gh-20601
parent
70aa7887
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
3 additions
and
26 deletions
+3
-26
ExposeExcludePropertyEndpointFilterTests.java
...re/endpoint/ExposeExcludePropertyEndpointFilterTests.java
+1
-8
HealthEndpointSupportTests.java
...ework/boot/actuate/health/HealthEndpointSupportTests.java
+0
-7
AutoConfigurationImportSelectorTests.java
...t/autoconfigure/AutoConfigurationImportSelectorTests.java
+1
-3
MockitoContextCustomizerFactoryTests.java
...st/mock/mockito/MockitoContextCustomizerFactoryTests.java
+1
-8
No files found.
spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/endpoint/ExposeExcludePropertyEndpointFilterTests.java
View file @
ef9f1d39
/*
/*
* Copyright 2012-20
19
the original author or authors.
* Copyright 2012-20
20
the original author or authors.
*
*
* Licensed under the Apache License, Version 2.0 (the "License");
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* you may not use this file except in compliance with the License.
...
@@ -16,9 +16,7 @@
...
@@ -16,9 +16,7 @@
package
org
.
springframework
.
boot
.
actuate
.
autoconfigure
.
endpoint
;
package
org
.
springframework
.
boot
.
actuate
.
autoconfigure
.
endpoint
;
import
org.junit.jupiter.api.BeforeEach
;
import
org.junit.jupiter.api.Test
;
import
org.junit.jupiter.api.Test
;
import
org.mockito.MockitoAnnotations
;
import
org.springframework.boot.actuate.endpoint.EndpointFilter
;
import
org.springframework.boot.actuate.endpoint.EndpointFilter
;
import
org.springframework.boot.actuate.endpoint.EndpointId
;
import
org.springframework.boot.actuate.endpoint.EndpointId
;
...
@@ -40,11 +38,6 @@ class ExposeExcludePropertyEndpointFilterTests {
...
@@ -40,11 +38,6 @@ class ExposeExcludePropertyEndpointFilterTests {
private
ExposeExcludePropertyEndpointFilter
<?>
filter
;
private
ExposeExcludePropertyEndpointFilter
<?>
filter
;
@BeforeEach
void
setup
()
{
MockitoAnnotations
.
initMocks
(
this
);
}
@Test
@Test
void
createWhenEndpointTypeIsNullShouldThrowException
()
{
void
createWhenEndpointTypeIsNullShouldThrowException
()
{
assertThatIllegalArgumentException
()
assertThatIllegalArgumentException
()
...
...
spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/health/HealthEndpointSupportTests.java
View file @
ef9f1d39
...
@@ -20,9 +20,7 @@ import java.util.Collections;
...
@@ -20,9 +20,7 @@ import java.util.Collections;
import
java.util.LinkedHashMap
;
import
java.util.LinkedHashMap
;
import
java.util.Map
;
import
java.util.Map
;
import
org.junit.jupiter.api.BeforeEach
;
import
org.junit.jupiter.api.Test
;
import
org.junit.jupiter.api.Test
;
import
org.mockito.MockitoAnnotations
;
import
org.springframework.boot.actuate.endpoint.SecurityContext
;
import
org.springframework.boot.actuate.endpoint.SecurityContext
;
import
org.springframework.boot.actuate.endpoint.http.ApiVersion
;
import
org.springframework.boot.actuate.endpoint.http.ApiVersion
;
...
@@ -59,11 +57,6 @@ abstract class HealthEndpointSupportTests<R extends ContributorRegistry<C>, C, T
...
@@ -59,11 +57,6 @@ abstract class HealthEndpointSupportTests<R extends ContributorRegistry<C>, C, T
this
.
registry
=
createRegistry
();
this
.
registry
=
createRegistry
();
}
}
@BeforeEach
void
setup
()
{
MockitoAnnotations
.
initMocks
(
this
);
}
@Test
@Test
void
createWhenRegistryIsNullThrowsException
()
{
void
createWhenRegistryIsNullThrowsException
()
{
assertThatIllegalArgumentException
().
isThrownBy
(()
->
create
(
null
,
this
.
groups
))
assertThatIllegalArgumentException
().
isThrownBy
(()
->
create
(
null
,
this
.
groups
))
...
...
spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/AutoConfigurationImportSelectorTests.java
View file @
ef9f1d39
/*
/*
* Copyright 2012-20
19
the original author or authors.
* Copyright 2012-20
20
the original author or authors.
*
*
* Licensed under the Apache License, Version 2.0 (the "License");
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* you may not use this file except in compliance with the License.
...
@@ -24,7 +24,6 @@ import java.util.Set;
...
@@ -24,7 +24,6 @@ import java.util.Set;
import
org.junit.jupiter.api.BeforeEach
;
import
org.junit.jupiter.api.BeforeEach
;
import
org.junit.jupiter.api.Test
;
import
org.junit.jupiter.api.Test
;
import
org.mockito.MockitoAnnotations
;
import
org.springframework.beans.BeansException
;
import
org.springframework.beans.BeansException
;
import
org.springframework.beans.factory.BeanFactory
;
import
org.springframework.beans.factory.BeanFactory
;
...
@@ -62,7 +61,6 @@ class AutoConfigurationImportSelectorTests {
...
@@ -62,7 +61,6 @@ class AutoConfigurationImportSelectorTests {
@BeforeEach
@BeforeEach
void
setup
()
{
void
setup
()
{
MockitoAnnotations
.
initMocks
(
this
);
this
.
importSelector
.
setBeanFactory
(
this
.
beanFactory
);
this
.
importSelector
.
setBeanFactory
(
this
.
beanFactory
);
this
.
importSelector
.
setEnvironment
(
this
.
environment
);
this
.
importSelector
.
setEnvironment
(
this
.
environment
);
this
.
importSelector
.
setResourceLoader
(
new
DefaultResourceLoader
());
this
.
importSelector
.
setResourceLoader
(
new
DefaultResourceLoader
());
...
...
spring-boot-project/spring-boot-test/src/test/java/org/springframework/boot/test/mock/mockito/MockitoContextCustomizerFactoryTests.java
View file @
ef9f1d39
/*
/*
* Copyright 2012-20
19
the original author or authors.
* Copyright 2012-20
20
the original author or authors.
*
*
* Licensed under the Apache License, Version 2.0 (the "License");
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* you may not use this file except in compliance with the License.
...
@@ -16,9 +16,7 @@
...
@@ -16,9 +16,7 @@
package
org
.
springframework
.
boot
.
test
.
mock
.
mockito
;
package
org
.
springframework
.
boot
.
test
.
mock
.
mockito
;
import
org.junit.jupiter.api.BeforeEach
;
import
org.junit.jupiter.api.Test
;
import
org.junit.jupiter.api.Test
;
import
org.mockito.MockitoAnnotations
;
import
org.springframework.test.context.ContextCustomizer
;
import
org.springframework.test.context.ContextCustomizer
;
...
@@ -33,11 +31,6 @@ class MockitoContextCustomizerFactoryTests {
...
@@ -33,11 +31,6 @@ class MockitoContextCustomizerFactoryTests {
private
final
MockitoContextCustomizerFactory
factory
=
new
MockitoContextCustomizerFactory
();
private
final
MockitoContextCustomizerFactory
factory
=
new
MockitoContextCustomizerFactory
();
@BeforeEach
void
setup
()
{
MockitoAnnotations
.
initMocks
(
this
);
}
@Test
@Test
void
getContextCustomizerWithoutAnnotationReturnsCustomizer
()
{
void
getContextCustomizerWithoutAnnotationReturnsCustomizer
()
{
ContextCustomizer
customizer
=
this
.
factory
.
createContextCustomizer
(
NoMockBeanAnnotation
.
class
,
null
);
ContextCustomizer
customizer
=
this
.
factory
.
createContextCustomizer
(
NoMockBeanAnnotation
.
class
,
null
);
...
...
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