diff --git a/spring-cloud-context/src/test/java/org/springframework/cloud/autoconfigure/RefreshAutoConfigurationMoreClassPathTests.java b/spring-cloud-context/src/test/java/org/springframework/cloud/autoconfigure/RefreshAutoConfigurationMoreClassPathTests.java index cc15022f..c2d8faa8 100644 --- a/spring-cloud-context/src/test/java/org/springframework/cloud/autoconfigure/RefreshAutoConfigurationMoreClassPathTests.java +++ b/spring-cloud-context/src/test/java/org/springframework/cloud/autoconfigure/RefreshAutoConfigurationMoreClassPathTests.java @@ -3,11 +3,11 @@ package org.springframework.cloud.autoconfigure; import org.junit.Rule; import org.junit.Test; import org.junit.runner.RunWith; + import org.springframework.boot.WebApplicationType; import org.springframework.boot.autoconfigure.EnableAutoConfiguration; import org.springframework.boot.builder.SpringApplicationBuilder; import org.springframework.boot.test.rule.OutputCapture; -import org.springframework.cloud.endpoint.event.RefreshEventListener; import org.springframework.cloud.test.ClassPathExclusions; import org.springframework.cloud.test.ModifiedClassPathRunner; import org.springframework.context.ConfigurableApplicationContext; diff --git a/spring-cloud-context/src/test/java/org/springframework/cloud/context/refresh/ContextRefresherTests.java b/spring-cloud-context/src/test/java/org/springframework/cloud/context/refresh/ContextRefresherTests.java index 34f92643..e4b7cc9c 100644 --- a/spring-cloud-context/src/test/java/org/springframework/cloud/context/refresh/ContextRefresherTests.java +++ b/spring-cloud-context/src/test/java/org/springframework/cloud/context/refresh/ContextRefresherTests.java @@ -118,7 +118,6 @@ public class ContextRefresherTests { } @Test - @SuppressWarnings("unchecked") public void commandLineArgsPassedToBootstrapConfiguration() { TestBootstrapConfiguration.fooSightings = new ArrayList<>(); diff --git a/spring-cloud-context/src/test/java/org/springframework/cloud/context/scope/refresh/RefreshScopeNullBeanIntegrationTests.java b/spring-cloud-context/src/test/java/org/springframework/cloud/context/scope/refresh/RefreshScopeNullBeanIntegrationTests.java index b02c5a30..755d994f 100644 --- a/spring-cloud-context/src/test/java/org/springframework/cloud/context/scope/refresh/RefreshScopeNullBeanIntegrationTests.java +++ b/spring-cloud-context/src/test/java/org/springframework/cloud/context/scope/refresh/RefreshScopeNullBeanIntegrationTests.java @@ -43,7 +43,8 @@ public class RefreshScopeNullBeanIntegrationTests { @Test @DirtiesContext public void testRefreshBean() { - assertThat(this.myCustomComponent).isNotNull(); + assertThat(this.myCustomComponent.optionalService).isNotNull(); + assertThat(this.scope).isNotNull(); // ...and then refresh, so the bean is re-initialized: // this.scope.refreshAll(); } diff --git a/spring-cloud-context/src/test/java/org/springframework/cloud/health/RefreshScopeHealthIndicatorTests.java b/spring-cloud-context/src/test/java/org/springframework/cloud/health/RefreshScopeHealthIndicatorTests.java index 4dbb5908..4009b8b9 100644 --- a/spring-cloud-context/src/test/java/org/springframework/cloud/health/RefreshScopeHealthIndicatorTests.java +++ b/spring-cloud-context/src/test/java/org/springframework/cloud/health/RefreshScopeHealthIndicatorTests.java @@ -21,6 +21,7 @@ import java.util.Collections; import org.junit.Before; import org.junit.Test; import org.mockito.BDDMockito; + import org.springframework.beans.factory.ObjectProvider; import org.springframework.boot.actuate.health.Status; import org.springframework.cloud.context.properties.ConfigurationPropertiesRebinder; @@ -35,6 +36,7 @@ import static org.mockito.Mockito.when; */ public class RefreshScopeHealthIndicatorTests { + @SuppressWarnings("unchecked") private ObjectProvider scopeProvider = mock(ObjectProvider.class); private ConfigurationPropertiesRebinder rebinder = mock(ConfigurationPropertiesRebinder.class);