Fix compiler warnings

This commit is contained in:
Dave Syer
2018-02-13 09:29:30 +00:00
parent 18ba863e5f
commit b5ac8fe725
4 changed files with 5 additions and 3 deletions

View File

@@ -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;

View File

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

View File

@@ -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();
}

View File

@@ -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<RefreshScope> scopeProvider = mock(ObjectProvider.class);
private ConfigurationPropertiesRebinder rebinder =
mock(ConfigurationPropertiesRebinder.class);