From 55ec016bac2313f0a115589601b65d0350d75b9f Mon Sep 17 00:00:00 2001 From: dreis2211 Date: Sat, 6 Oct 2018 11:01:00 +0200 Subject: [PATCH] Remove unused fields in tests Closes gh-14707 --- .../metrics/PropertiesMeterFilterTests.java | 11 ----------- .../ServletWebServerFactoryCustomizerTests.java | 7 ------- .../boot/cli/command/CommandRunnerTests.java | 3 --- 3 files changed, 21 deletions(-) diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/metrics/PropertiesMeterFilterTests.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/metrics/PropertiesMeterFilterTests.java index f8e6f551722..b773fbf6bd7 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/metrics/PropertiesMeterFilterTests.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/metrics/PropertiesMeterFilterTests.java @@ -24,12 +24,9 @@ import io.micrometer.core.instrument.Meter.Type; import io.micrometer.core.instrument.config.MeterFilterReply; import io.micrometer.core.instrument.distribution.DistributionStatisticConfig; import io.micrometer.core.instrument.simple.SimpleMeterRegistry; -import org.junit.Before; import org.junit.Rule; import org.junit.Test; import org.junit.rules.ExpectedException; -import org.mockito.Mock; -import org.mockito.MockitoAnnotations; import org.springframework.boot.context.properties.bind.Bindable; import org.springframework.boot.context.properties.bind.Binder; @@ -49,14 +46,6 @@ public class PropertiesMeterFilterTests { @Rule public ExpectedException thrown = ExpectedException.none(); - @Mock - private DistributionStatisticConfig config; - - @Before - public void setup() { - MockitoAnnotations.initMocks(this); - } - @Test public void createWhenPropertiesIsNullShouldThrowException() { this.thrown.expect(IllegalArgumentException.class); diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/servlet/ServletWebServerFactoryCustomizerTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/servlet/ServletWebServerFactoryCustomizerTests.java index e85ec09d54e..13cad668807 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/servlet/ServletWebServerFactoryCustomizerTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/servlet/ServletWebServerFactoryCustomizerTests.java @@ -24,8 +24,6 @@ import java.util.Map; import org.junit.Before; import org.junit.Test; import org.mockito.ArgumentCaptor; -import org.mockito.Captor; -import org.mockito.MockitoAnnotations; import org.springframework.boot.autoconfigure.web.ServerProperties; import org.springframework.boot.context.properties.bind.Bindable; @@ -33,7 +31,6 @@ import org.springframework.boot.context.properties.bind.Binder; import org.springframework.boot.context.properties.source.ConfigurationPropertySource; import org.springframework.boot.context.properties.source.MapConfigurationPropertySource; import org.springframework.boot.web.server.Ssl; -import org.springframework.boot.web.servlet.ServletContextInitializer; import org.springframework.boot.web.servlet.server.ConfigurableServletWebServerFactory; import org.springframework.boot.web.servlet.server.Jsp; import org.springframework.boot.web.servlet.server.Session; @@ -56,12 +53,8 @@ public class ServletWebServerFactoryCustomizerTests { private ServletWebServerFactoryCustomizer customizer; - @Captor - private ArgumentCaptor initializersCaptor; - @Before public void setup() { - MockitoAnnotations.initMocks(this); this.customizer = new ServletWebServerFactoryCustomizer(this.properties); } diff --git a/spring-boot-project/spring-boot-cli/src/test/java/org/springframework/boot/cli/command/CommandRunnerTests.java b/spring-boot-project/spring-boot-cli/src/test/java/org/springframework/boot/cli/command/CommandRunnerTests.java index 7d56193ece6..989db667e63 100644 --- a/spring-boot-project/spring-boot-cli/src/test/java/org/springframework/boot/cli/command/CommandRunnerTests.java +++ b/spring-boot-project/spring-boot-cli/src/test/java/org/springframework/boot/cli/command/CommandRunnerTests.java @@ -51,9 +51,6 @@ public class CommandRunnerTests { @Mock private Command regularCommand; - @Mock - private Command shellCommand; - @Mock private Command anotherCommand;