Fix typos in tests

See gh-23050
pull/23052/head
dreis2211 4 years ago committed by Phillip Webb
parent d123c924a0
commit f7d6f38368

@ -154,7 +154,7 @@ class CloudPlatformTests {
} }
@Test @Test
void isEnforcedWhenEnvironmentPropertyIsMissingatchReturnsFalse() { void isEnforcedWhenEnvironmentPropertyIsMissingReturnsFalse() {
MockEnvironment environment = new MockEnvironment(); MockEnvironment environment = new MockEnvironment();
assertThat(CloudPlatform.KUBERNETES.isEnforced(environment)).isFalse(); assertThat(CloudPlatform.KUBERNETES.isEnforced(environment)).isFalse();
} }
@ -172,7 +172,7 @@ class CloudPlatformTests {
} }
@Test @Test
void isEnforcedWhenBinderPropertyIsMissingatchReturnsFalse() { void isEnforcedWhenBinderPropertyIsMissingReturnsFalse() {
Binder binder = new Binder(new MockConfigurationPropertySource()); Binder binder = new Binder(new MockConfigurationPropertySource());
assertThat(CloudPlatform.KUBERNETES.isEnforced(binder)).isFalse(); assertThat(CloudPlatform.KUBERNETES.isEnforced(binder)).isFalse();
} }

@ -50,8 +50,8 @@ class ConfigDataActivationContextTests {
} }
@Test @Test
void getCloudPlatformWhenClouldPropertyInEnvironmentDeducesCloudPlatform() { void getCloudPlatformWhenCloudPropertyInEnvironmentDeducesCloudPlatform() {
MockEnvironment environment = createKuberntesEnvironment(); MockEnvironment environment = createKubernetesEnvironment();
Binder binder = Binder.get(environment); Binder binder = Binder.get(environment);
ConfigDataActivationContext context = new ConfigDataActivationContext(environment, binder); ConfigDataActivationContext context = new ConfigDataActivationContext(environment, binder);
assertThat(context.getCloudPlatform()).isEqualTo(CloudPlatform.KUBERNETES); assertThat(context.getCloudPlatform()).isEqualTo(CloudPlatform.KUBERNETES);
@ -59,7 +59,7 @@ class ConfigDataActivationContextTests {
@Test @Test
void getCloudPlatformWhenCloudPropertyHasBeenContributedDuringInitialLoadDeducesCloudPlatform() { void getCloudPlatformWhenCloudPropertyHasBeenContributedDuringInitialLoadDeducesCloudPlatform() {
Environment environment = createKuberntesEnvironment(); Environment environment = createKubernetesEnvironment();
Binder binder = new Binder( Binder binder = new Binder(
new MapConfigurationPropertySource(Collections.singletonMap("spring.main.cloud-platform", "HEROKU"))); new MapConfigurationPropertySource(Collections.singletonMap("spring.main.cloud-platform", "HEROKU")));
ConfigDataActivationContext context = new ConfigDataActivationContext(environment, binder); ConfigDataActivationContext context = new ConfigDataActivationContext(environment, binder);
@ -85,7 +85,7 @@ class ConfigDataActivationContextTests {
assertThat(context.getProfiles()).isEqualTo(profiles); assertThat(context.getProfiles()).isEqualTo(profiles);
} }
private MockEnvironment createKuberntesEnvironment() { private MockEnvironment createKubernetesEnvironment() {
MockEnvironment environment = new MockEnvironment(); MockEnvironment environment = new MockEnvironment();
Map<String, Object> map = new LinkedHashMap<>(); Map<String, Object> map = new LinkedHashMap<>();
map.put("KUBERNETES_SERVICE_HOST", "host"); map.put("KUBERNETES_SERVICE_HOST", "host");

@ -218,7 +218,7 @@ class ConfigDataEnvironmentPostProcessorIntegrationTests {
} }
@Test @Test
void runWhenHasSystemPropertyLoadsWithSystemPropertyTakingPrecendence() { void runWhenHasSystemPropertyLoadsWithSystemPropertyTakingPrecedence() {
System.setProperty("the.property", "fromsystem"); System.setProperty("the.property", "fromsystem");
ConfigurableApplicationContext context = this.application.run("--spring.config.name=testproperties"); ConfigurableApplicationContext context = this.application.run("--spring.config.name=testproperties");
String property = context.getEnvironment().getProperty("the.property"); String property = context.getEnvironment().getProperty("the.property");
@ -226,7 +226,7 @@ class ConfigDataEnvironmentPostProcessorIntegrationTests {
} }
@Test @Test
void runWhenHasDefaultPropertiesIncluesDefaultPropertiesLast() { void runWhenHasDefaultPropertiesIncludesDefaultPropertiesLast() {
this.application.setDefaultProperties(Collections.singletonMap("my.fallback", "foo")); this.application.setDefaultProperties(Collections.singletonMap("my.fallback", "foo"));
ConfigurableApplicationContext context = this.application.run(); ConfigurableApplicationContext context = this.application.run();
String property = context.getEnvironment().getProperty("my.fallback"); String property = context.getEnvironment().getProperty("my.fallback");
@ -249,7 +249,7 @@ class ConfigDataEnvironmentPostProcessorIntegrationTests {
} }
@Test @Test
void runWhenProgrammticallySetProfilesLoadsWithSetProfilesTakePrecedenceOverDefaultProfile() { void runWhenProgrammaticallySetProfilesLoadsWithSetProfilesTakePrecedenceOverDefaultProfile() {
this.application.setAdditionalProfiles("other"); this.application.setAdditionalProfiles("other");
ConfigurableApplicationContext context = this.application.run(); ConfigurableApplicationContext context = this.application.run();
String property = context.getEnvironment().getProperty("my.property"); String property = context.getEnvironment().getProperty("my.property");

@ -149,7 +149,7 @@ class ConfigDataEnvironmentTests {
} }
@Test @Test
void processAndApplyMovesDefaultProperySourceToLast(TestInfo info) { void processAndApplyMovesDefaultPropertySourceToLast(TestInfo info) {
MockPropertySource defaultPropertySource = new MockPropertySource("defaultProperties"); MockPropertySource defaultPropertySource = new MockPropertySource("defaultProperties");
this.environment.getPropertySources().addFirst(defaultPropertySource); this.environment.getPropertySources().addFirst(defaultPropertySource);
this.environment.setProperty("spring.config.location", getConfigLocation(info)); this.environment.setProperty("spring.config.location", getConfigLocation(info));
@ -188,7 +188,7 @@ class ConfigDataEnvironmentTests {
} }
@Test @Test
@Disabled("Disabled until spring.profiles suppport is dropped") @Disabled("Disabled until spring.profiles support is dropped")
void processAndApplyWhenHasInvalidPropertyThrowsException() { void processAndApplyWhenHasInvalidPropertyThrowsException() {
this.environment.setProperty("spring.profile", "a"); this.environment.setProperty("spring.profile", "a");
ConfigDataEnvironment configDataEnvironment = new ConfigDataEnvironment(this.logFactory, this.bootstrapRegistry, ConfigDataEnvironment configDataEnvironment = new ConfigDataEnvironment(this.logFactory, this.bootstrapRegistry,

@ -42,9 +42,9 @@ class InvalidConfigDataPropertyExceptionTests {
private ConfigurationPropertyName replacement = ConfigurationPropertyName.of("replacement"); private ConfigurationPropertyName replacement = ConfigurationPropertyName.of("replacement");
private ConfigurationPropertyName invaid = ConfigurationPropertyName.of("invalid"); private ConfigurationPropertyName invalid = ConfigurationPropertyName.of("invalid");
private ConfigurationProperty property = new ConfigurationProperty(this.invaid, "bad", MockOrigin.of("origin")); private ConfigurationProperty property = new ConfigurationProperty(this.invalid, "bad", MockOrigin.of("origin"));
private Log logger = mock(Log.class); private Log logger = mock(Log.class);
@ -68,7 +68,7 @@ class InvalidConfigDataPropertyExceptionTests {
@Test @Test
void createWhenNoOriginHasCorrectMessage() { void createWhenNoOriginHasCorrectMessage() {
ConfigurationProperty property = new ConfigurationProperty(this.invaid, "bad", null); ConfigurationProperty property = new ConfigurationProperty(this.invalid, "bad", null);
assertThat(new InvalidConfigDataPropertyException(property, this.replacement, this.location)).hasMessage( assertThat(new InvalidConfigDataPropertyException(property, this.replacement, this.location)).hasMessage(
"Property 'invalid' imported from location 'test' is invalid and should be replaced with 'replacement'"); "Property 'invalid' imported from location 'test' is invalid and should be replaced with 'replacement'");
} }
@ -95,7 +95,7 @@ class InvalidConfigDataPropertyExceptionTests {
} }
@Test @Test
@Disabled("Disabled until spring.profiles suppport is dropped") @Disabled("Disabled until spring.profiles support is dropped")
void throwOrWarnWhenHasInvalidPropertyThrowsException() { void throwOrWarnWhenHasInvalidPropertyThrowsException() {
MockPropertySource propertySource = new MockPropertySource(); MockPropertySource propertySource = new MockPropertySource();
propertySource.setProperty("spring.profiles", "a"); propertySource.setProperty("spring.profiles", "a");

@ -50,7 +50,7 @@ class NotConstructorBoundInjectionFailureAnalyzerTests {
} }
@Test @Test
void failureAnaylsisForNonConstructorBoundProperties() { void failureAnalysisForNonConstructorBoundProperties() {
FailureAnalysis analysis = analyzeFailure(createFailure(JavaBeanBoundPropertiesConfiguration.class)); FailureAnalysis analysis = analyzeFailure(createFailure(JavaBeanBoundPropertiesConfiguration.class));
assertThat(analysis).isNull(); assertThat(analysis).isNull();
} }

@ -49,7 +49,7 @@ class PropertiesPropertySourceLoaderTests {
} }
@Test @Test
void loadMultiDocumentPropertiesWithSeparatorAtTheBeginningofFile() throws Exception { void loadMultiDocumentPropertiesWithSeparatorAtTheBeginningOfFile() throws Exception {
List<PropertySource<?>> loaded = this.loader.load("test.properties", List<PropertySource<?>> loaded = this.loader.load("test.properties",
new ClassPathResource("multi-document-properties-2.properties", getClass())); new ClassPathResource("multi-document-properties-2.properties", getClass()));
assertThat(loaded.size()).isEqualTo(2); assertThat(loaded.size()).isEqualTo(2);

@ -269,7 +269,7 @@ class DefaultErrorAttributesTests {
} }
@Test @Test
void whenGetMessageIsOverridenThenMessageAttributeContainsValueReturnedFromIt() { void whenGetMessageIsOverriddenThenMessageAttributeContainsValueReturnedFromIt() {
Map<String, Object> attributes = new DefaultErrorAttributes() { Map<String, Object> attributes = new DefaultErrorAttributes() {
@Override @Override

Loading…
Cancel
Save