Skip to content

Commit

Permalink
Polish
Browse files Browse the repository at this point in the history
  • Loading branch information
izeye authored and snicoll committed Mar 30, 2016
1 parent 8a11620 commit a28dd9d
Show file tree
Hide file tree
Showing 34 changed files with 89 additions and 89 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ public void logAutoConfigurationReport(boolean isCrashReport) {
+ "debug logging (start with --debug)%n%n"));
}
if (this.logger.isDebugEnabled()) {
this.logger.debug(new ConditionEvalutionReportMessage(this.report));
this.logger.debug(new ConditionEvaluationReportMessage(this.report));
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,11 @@
* @author Phillip Webb
* @since 1.4.0
*/
public class ConditionEvalutionReportMessage {
public class ConditionEvaluationReportMessage {

private StringBuilder message;

public ConditionEvalutionReportMessage(ConditionEvaluationReport report) {
public ConditionEvaluationReportMessage(ConditionEvaluationReport report) {
this.message = getLogMessage(report);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,14 +47,14 @@ private void testConfigImports(Class<?> config) {
config);
String shortName = ClassUtils.getShortName(ImportAutoConfigurationTests.class);
int beginIndex = shortName.length() + 1;
List<String> orderdConfigBeans = new ArrayList<String>();
List<String> orderedConfigBeans = new ArrayList<String>();
for (String bean : context.getBeanDefinitionNames()) {
if (bean.contains("$Config")) {
String shortBeanName = ClassUtils.getShortName(bean);
orderdConfigBeans.add(shortBeanName.substring(beginIndex));
orderedConfigBeans.add(shortBeanName.substring(beginIndex));
}
}
assertThat(orderdConfigBeans).containsExactly("ConfigA", "ConfigB", "ConfigC",
assertThat(orderedConfigBeans).containsExactly("ConfigA", "ConfigB", "ConfigC",
"ConfigD");
context.close();
}
Expand Down
6 changes: 3 additions & 3 deletions spring-boot-docs/src/main/asciidoc/spring-boot-features.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -4306,7 +4306,7 @@ If you use the
the following provided libraries:

* http://junit.org[JUnit] -- The de-facto standard for unit testing Java applications.
* {spring-reference}/#integration-testing.html[Spring Test] & Spring Boot Test -- utilties and integration test support for Spring Boot
* {spring-reference}/#integration-testing.html[Spring Test] & Spring Boot Test -- utilities and integration test support for Spring Boot
applications.
* http://joel-costigliola.github.io/assertj/[AssertJ] - A fluent assertion library.
* http://hamcrest.org/JavaHamcrest/[Hamcrest] -- A library of matcher objects (also known
Expand Down Expand Up @@ -4599,7 +4599,7 @@ a little too much for tests. It's often helpful to load only the parts of the
configuration that are required to test a '`slice`' of your application. For example, you
might want to test that Spring MVC controllers are mapping URLs correctly, and you don't
want to involve and database calls in those tests; or you _might be wanting_ to test JPA
entites, and you're not interested in web layer when those tests run.
entities, and you're not interested in web layer when those tests run.

The `spring-boot-test-autoconfigure` module includes a number of annotations that can be
used to automatically configure such '`slices`'. Each of them work in a similar way,
Expand All @@ -4615,7 +4615,7 @@ TIP: It's also possible to use the `@AutoConfigure...` annotations with the stan

[[boot-features-testing-spring-boot-applications-testing-autoconfigured-json-tests]]
==== Auto-configured JSON tests
To test that Object JSON serilization and deserialization is working as expected you can
To test that Object JSON serialization and deserialization is working as expected you can
use the `@JsonTest` annotation. `@JsonTest` will auto-configure Jackson ObjectMappers,
any `@JsonComponent` beans and any Jackson `Modules`. It also configures `Gson`
if you happen to be using that instead of, or as well as, Jackson. If you need to
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public void getVehicleWhenRequestingTextShouldReturnMakeAndModel() throws Except
}

@Test
public void welcomeCommandLineRunnerShouldBeAvailble() throws Exception {
public void welcomeCommandLineRunnerShouldBeAvailable() throws Exception {
// Since we're a @SpringApplicationTest all beans should be available
assertThat(this.applicationContext.getBean(WelcomeCommandLineRunner.class))
.isNotNull();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ public void getVehicleWhenVinNotFoundShouldReturnNotFound() throws Exception {
}

@Test(expected = NoSuchBeanDefinitionException.class)
public void welcomeCommandLineRunnerShouldBeAvailble() throws Exception {
public void welcomeCommandLineRunnerShouldBeAvailable() throws Exception {
// Since we're a @WebMvcTest WelcomeCommandLineRunner should not be available
assertThat(this.applicationContext.getBean(WelcomeCommandLineRunner.class));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
package org.springframework.boot.test.autoconfigure;

import org.springframework.boot.autoconfigure.condition.ConditionEvaluationReport;
import org.springframework.boot.autoconfigure.logging.ConditionEvalutionReportMessage;
import org.springframework.boot.autoconfigure.logging.ConditionEvaluationReportMessage;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.test.context.TestContext;
Expand Down Expand Up @@ -50,7 +50,7 @@ public void prepareTestInstance(TestContext testContext) throws Exception {
if (context instanceof ConfigurableApplicationContext) {
ConditionEvaluationReport report = ConditionEvaluationReport
.get(((ConfigurableApplicationContext) context).getBeanFactory());
System.err.println(new ConditionEvalutionReportMessage(report));
System.err.println(new ConditionEvaluationReportMessage(report));
}
throw ex;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
/**
* Annotation that can be used to override
* {@link EnableAutoConfiguration @EnableAutoConfiguration}. Often used in combination
* with {@link ImportAutoConfiguration} to limit the auto-configutation classes that are
* with {@link ImportAutoConfiguration} to limit the auto-configuration classes that are
* loaded.
*
* @author Phillip Webb
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ && defaultInclude(metadataReader, metadataReaderFactory)) {

protected boolean defaultInclude(MetadataReader metadataReader,
MetadataReaderFactory metadataReaderFactory) throws IOException {
for (Class<?> include : getDefaultIncudes()) {
for (Class<?> include : getDefaultIncludes()) {
if (isTypeOrAnnotated(metadataReader, metadataReaderFactory, include)) {
return true;
}
Expand Down Expand Up @@ -101,7 +101,7 @@ protected final boolean isTypeOrAnnotated(MetadataReader metadataReader,

protected abstract boolean isUseDefaultFilters();

protected abstract Set<Class<?>> getDefaultIncudes();
protected abstract Set<Class<?>> getDefaultIncludes();

protected static enum FilterType {
INCLUDE, EXCLUDE
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,13 +72,13 @@ private TypeFilter createTypeFilter(FilterType filterType, Class<?> filterClass)
switch (filterType) {
case ANNOTATION:
Assert.isAssignable(Annotation.class, filterClass,
"An error occured while processing a ANNOTATION type filter: ");
"An error occurred while processing a ANNOTATION type filter: ");
return new AnnotationTypeFilter((Class<Annotation>) filterClass);
case ASSIGNABLE_TYPE:
return new AssignableTypeFilter(filterClass);
case CUSTOM:
Assert.isAssignable(TypeFilter.class, filterClass,
"An error occured while processing a CUSTOM type filter: ");
"An error occurred while processing a CUSTOM type filter: ");
return BeanUtils.instantiateClass(filterClass, TypeFilter.class);
}
throw new IllegalArgumentException(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ protected boolean isUseDefaultFilters() {
}

@Override
protected Set<Class<?>> getDefaultIncudes() {
protected Set<Class<?>> getDefaultIncludes() {
return DEFAULT_INCLUDES;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,14 @@ public class JsonTesterInitializationTestExecutionListener

private static final String ASSERTJ_CLASS = "org.assertj.core.api.Assert";

private static final Map<String, Class<?>> INITALIZERS;
private static final Map<String, Class<?>> INITIALIZERS;

static {
Map<String, Class<?>> initializers = new LinkedHashMap<String, Class<?>>();
initializers.put("com.fasterxml.jackson.databind.ObjectMapper",
JacksonInitializer.class);
initializers.put("com.google.gson.Gson", GsonInitializer.class);
INITALIZERS = Collections.unmodifiableMap(initializers);
INITIALIZERS = Collections.unmodifiableMap(initializers);
}

@Override
Expand Down Expand Up @@ -101,7 +101,7 @@ private void setupField(Field field) {

private void initializeJsonMarshalTesterFields(ClassLoader classLoader,
TestContext testContext) {
for (Map.Entry<String, Class<?>> entry : INITALIZERS.entrySet()) {
for (Map.Entry<String, Class<?>> entry : INITIALIZERS.entrySet()) {
if (ClassUtils.isPresent(entry.getKey(), classLoader)) {
initializeJsonMarshalTesterFields(classLoader, testContext,
entry.getKey(), entry.getValue());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ protected boolean defaultInclude(MetadataReader metadataReader,
}

@Override
protected Set<Class<?>> getDefaultIncudes() {
protected Set<Class<?>> getDefaultIncludes() {
return Collections.emptySet();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ public <E> E persist(E entity) {
* {@link #getId(Object) entity ID}.
* <p>
* Helpful when ensuring that entity data is actually written and read from the
* underling database correctly.
* underlying database correctly.
* @param <E> the entity type
* @param entity the entity to persist
* @return the entity found using the ID of the persisted entity
Expand Down Expand Up @@ -226,7 +226,7 @@ public Object getId(Object entity) {
@SuppressWarnings("unchecked")
public <T> T getId(Object entity, Class<T> idType) {
Object id = getId(entity);
Assert.isInstanceOf(idType, id, "ID missmatch");
Assert.isInstanceOf(idType, id, "ID mismatch");
return (T) id;
}

Expand All @@ -238,7 +238,7 @@ public <T> T getId(Object entity, Class<T> idType) {
public final EntityManager getEntityManager() {
EntityManager manager = EntityManagerFactoryUtils
.getTransactionalEntityManager(this.entityManagerFactory);
Assert.state(manager != null, "No transactional EnitiyManager found");
Assert.state(manager != null, "No transactional EntityManager found");
return manager;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
* By default, tests annotated with {@code @WebMvcTest} will also auto-configure
* {@link MockMvc} (include support for HtmlUnit WebDriver and Selenium WebClient). For
* more fine-grained control of MockMVC that
* {@link AutoConfigureMockMvc @AutoConfigureMockMvc} annotation cab be used.
* {@link AutoConfigureMockMvc @AutoConfigureMockMvc} annotation can be used.
* <p>
* Typically {@code @WebMvcTest} is used in combination with {@link MockBean @MockBean} or
* {@link Import @Import} to create any collaborators required by your {@code @Controller}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ protected boolean isUseDefaultFilters() {
}

@Override
protected Set<Class<?>> getDefaultIncudes() {
protected Set<Class<?>> getDefaultIncludes() {
if (ObjectUtils.isEmpty(this.annotation.controllers())) {
return DEFAULT_INCLUDES_AND_CONTROLLER;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public void orderShouldBeBeforeDependencyInjectionTestExecutionListener()
}

@Test
public void prepareFialingTestInstanceShouldPrintReport() throws Exception {
public void prepareFailingTestInstanceShouldPrintReport() throws Exception {
TestContext testContext = mock(TestContext.class);
given(testContext.getTestInstance()).willThrow(new IllegalStateException());
SpringApplication application = new SpringApplication(Config.class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public class OverrideAutoConfigurationEnabledTrueIntegrationTest {
private ApplicationContext context;

@Test
public void autoconfiguredContext() throws Exception {
public void autoConfiguredContext() throws Exception {
ApplicationContext context = this.context;
assertThat(context.getBean(ExampleSpringBootApplication.class)).isNotNull();
assertThat(context.getBean(ConfigurationPropertiesBindingPostProcessor.class))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,10 @@ protected void serializeObject(ExampleCustomObject value, JsonGenerator jgen,

}

public static class Deserialzer extends JsonObjectDeserializer<ExampleCustomObject> {
public static class Deserializer extends JsonObjectDeserializer<ExampleCustomObject> {

@Override
protected ExampleCustomObject deserializeObject(JsonParser jasonParser,
protected ExampleCustomObject deserializeObject(JsonParser jsonParser,
DeserializationContext context, ObjectCodec codec, JsonNode tree)
throws IOException {
return new ExampleCustomObject(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ public void getIdForTypeShouldGetId() throws Exception {
public void getIdForTypeWhenTypeIsWrongShouldThrowException() throws Exception {
TestEntity entity = new TestEntity();
given(this.persistenceUnitUtil.getIdentifier(entity)).willReturn(123);
this.thrown.expectMessage("ID missmatch Object of class [java.lang.Integer] "
this.thrown.expectMessage("ID mismatch Object of class [java.lang.Integer] "
+ "must be an instance of class java.lang.Long");
this.testEntityManager.getId(entity, Long.class);
}
Expand All @@ -225,7 +225,7 @@ public void getEntityManagerShouldGetEntityManager() throws Exception {
@Test
public void getEntityManagerWhenNotSetShouldThrowException() throws Exception {
this.thrown.expect(IllegalStateException.class);
this.thrown.expectMessage("No transactional EnitiyManager found");
this.thrown.expectMessage("No transactional EntityManager found");
this.testEntityManager.getEntityManager();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ public void propertiesWhenNotMappedAtAttributeLevelShouldIgnoreAttributes()
}

@Test
public void propertiesWhenCountainsArryasShouldExpandNames() throws Exception {
public void propertiesWhenContainsArraysShouldExpandNames() throws Exception {
AnnotationsPropertySource source = new AnnotationsPropertySource(Arrays.class);
assertThat(source.getPropertyNames()).contains("strings[0]", "strings[1]",
"classes[0]", "classes[1]", "ints[0]", "ints[1]", "longs[0]", "longs[1]",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
import java.lang.annotation.RetentionPolicy;

/**
* Example {@link PropertyMapping} annotation for use wuth {@link PropertyMappingTests}.
* Example {@link PropertyMapping} annotation for use with {@link PropertyMappingTests}.
*
* @author Phillip Webb
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ public void getContextCustomizerWhenHasAttributeMappingShouldReturnCustomizer()
}

@Test
public void hashCodeAndEqualsShoudBeBasedOnPropertyValues() throws Exception {
public void hashCodeAndEqualsShouldBeBasedOnPropertyValues() throws Exception {
ContextCustomizer customizer1 = this.factory
.createContextCustomizer(TypeMapping.class, null);
ContextCustomizer customizer2 = this.factory
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
import static org.assertj.core.api.Assertions.assertThat;

/**
* Integration tests for {@link PropertyMapping @PropertyMapping} annotaions.
* Integration tests for {@link PropertyMapping @PropertyMapping} annotations.
*
* @author Phillip Webb
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ private List<String> getAndProcessPropertySourceProperties(
* differentiate regular tests and bootstrapped tests. Without this property a cached
* context could be returned that wasn't created by this bootstrapper. By default uses
* the bootstrapper class as a property.
* @return the differentator or {@code null}
* @return the differentiator or {@code null}
*/
protected String getDifferentiatorPropertySourceProperty() {
return getClass().getName() + "=true";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@
* When {@code @MockBean} also defines a {@code name} this attribute can only contain
* a single value.
* <p>
* If this is the only attribute specified consider using the {@code value} alais
* If this is the only attribute specified consider using the {@code value} alias
* instead.
*/
@AliasFor("value")
Expand Down
Loading

0 comments on commit a28dd9d

Please sign in to comment.