Browse Source

Fix compiler warnings

pull/323/head
Dave Syer 7 years ago
parent
commit
b5ac8fe725
  1. 2
      spring-cloud-context/src/test/java/org/springframework/cloud/autoconfigure/RefreshAutoConfigurationMoreClassPathTests.java
  2. 1
      spring-cloud-context/src/test/java/org/springframework/cloud/context/refresh/ContextRefresherTests.java
  3. 3
      spring-cloud-context/src/test/java/org/springframework/cloud/context/scope/refresh/RefreshScopeNullBeanIntegrationTests.java
  4. 2
      spring-cloud-context/src/test/java/org/springframework/cloud/health/RefreshScopeHealthIndicatorTests.java

2
spring-cloud-context/src/test/java/org/springframework/cloud/autoconfigure/RefreshAutoConfigurationMoreClassPathTests.java

@ -3,11 +3,11 @@ package org.springframework.cloud.autoconfigure; @@ -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;

1
spring-cloud-context/src/test/java/org/springframework/cloud/context/refresh/ContextRefresherTests.java

@ -118,7 +118,6 @@ public class ContextRefresherTests { @@ -118,7 +118,6 @@ public class ContextRefresherTests {
}
@Test
@SuppressWarnings("unchecked")
public void commandLineArgsPassedToBootstrapConfiguration() {
TestBootstrapConfiguration.fooSightings = new ArrayList<>();

3
spring-cloud-context/src/test/java/org/springframework/cloud/context/scope/refresh/RefreshScopeNullBeanIntegrationTests.java

@ -43,7 +43,8 @@ public class RefreshScopeNullBeanIntegrationTests { @@ -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();
}

2
spring-cloud-context/src/test/java/org/springframework/cloud/health/RefreshScopeHealthIndicatorTests.java

@ -21,6 +21,7 @@ import java.util.Collections; @@ -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; @@ -35,6 +36,7 @@ import static org.mockito.Mockito.when;
*/
public class RefreshScopeHealthIndicatorTests {
@SuppressWarnings("unchecked")
private ObjectProvider<RefreshScope> scopeProvider = mock(ObjectProvider.class);
private ConfigurationPropertiesRebinder rebinder =
mock(ConfigurationPropertiesRebinder.class);

Loading…
Cancel
Save