Merge pull request #12156 from izeye:polish-20180222
* pr/12156: Polish
This commit is contained in:
@@ -58,7 +58,7 @@ import static org.springframework.restdocs.payload.PayloadDocumentation.fieldWit
|
||||
@TestPropertySource(properties = { "spring.jackson.serialization.indent_output=true",
|
||||
"management.endpoints.web.exposure.include=*",
|
||||
"spring.jackson.default-property-inclusion=non_null" })
|
||||
public class AbstractEndpointDocumentationTests {
|
||||
public abstract class AbstractEndpointDocumentationTests {
|
||||
|
||||
protected String describeEnumValues(Class<? extends Enum<?>> enumType) {
|
||||
return StringUtils
|
||||
|
||||
@@ -2653,7 +2653,7 @@ Spring WebFlux provides a `WebFilter` interface that can be implemented to filte
|
||||
request-response exchanges. `WebFilter` beans found in the application context will
|
||||
be automatically used to filter each exchange.
|
||||
|
||||
Where the order of the filters is important they can implemented `Ordered` or be annotated
|
||||
Where the order of the filters is important they can implement `Ordered` or be annotated
|
||||
with `@Order`. Spring Boot auto-configuration may configure web filters for you. When it
|
||||
does so, the orders shown in the following table will be used:
|
||||
|
||||
@@ -5721,8 +5721,8 @@ The following example shows how to inject `ConnectionFactory` instances:
|
||||
|
||||
[[boot-features-jta-supporting-alternative-embedded]]
|
||||
=== Supporting an Alternative Embedded Transaction Manager
|
||||
The {sc-spring-boot}/jta/XAConnectionFactoryWrapper.{sc-ext}[`XAConnectionFactoryWrapper`]
|
||||
and {sc-spring-boot}/jta/XADataSourceWrapper.{sc-ext}[`XADataSourceWrapper`] interfaces
|
||||
The {sc-spring-boot}/jms/XAConnectionFactoryWrapper.{sc-ext}[`XAConnectionFactoryWrapper`]
|
||||
and {sc-spring-boot}/jdbc/XADataSourceWrapper.{sc-ext}[`XADataSourceWrapper`] interfaces
|
||||
can be used to support alternative embedded transaction managers. The interfaces are
|
||||
responsible for wrapping `XAConnectionFactory` and `XADataSource` beans and exposing them
|
||||
as regular `ConnectionFactory` and `DataSource` beans, which transparently enroll in the
|
||||
|
||||
@@ -24,7 +24,7 @@ import java.lang.annotation.Target;
|
||||
import java.time.Duration;
|
||||
|
||||
/**
|
||||
* Annotation that can be used to indivate the format to use when converting a
|
||||
* Annotation that can be used to indicate the format to use when converting a
|
||||
* {@link Duration}.
|
||||
*
|
||||
* @author Phillip Webb
|
||||
|
||||
@@ -36,14 +36,15 @@ class ProfileToLoadDocumentMatcher extends SpringProfilesDocumentMatcher {
|
||||
@Override
|
||||
protected boolean matches(String[] profiles) {
|
||||
String[] positiveProfiles = (profiles == null ? null : Arrays.stream(profiles)
|
||||
.filter(this::isPositveProfile).toArray(String[]::new));
|
||||
.filter(this::isPositiveProfile).toArray(String[]::new));
|
||||
if (this.profile == null) {
|
||||
return ObjectUtils.isEmpty(positiveProfiles);
|
||||
}
|
||||
return ObjectUtils.containsElement(positiveProfiles, this.profile);
|
||||
}
|
||||
|
||||
private boolean isPositveProfile(String profile) {
|
||||
private boolean isPositiveProfile(String profile) {
|
||||
return !profile.startsWith("!");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -21,7 +21,7 @@ import javax.sql.XADataSource;
|
||||
import javax.transaction.TransactionManager;
|
||||
|
||||
/**
|
||||
* Strategy interface used to wrap a JMS {@link XADataSource} enrolling it with a JTA
|
||||
* Strategy interface used to wrap an {@link XADataSource} enrolling it with a JTA
|
||||
* {@link TransactionManager}.
|
||||
*
|
||||
* @author Phillip Webb
|
||||
|
||||
@@ -19,9 +19,7 @@ package org.springframework.boot.convert;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import org.junit.rules.ExpectedException;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.junit.runners.Parameterized;
|
||||
import org.junit.runners.Parameterized.Parameters;
|
||||
@@ -48,9 +46,6 @@ public class DelimitedStringToArrayConverterTests {
|
||||
this.conversionService = conversionService;
|
||||
}
|
||||
|
||||
@Rule
|
||||
public ExpectedException thrown = ExpectedException.none();
|
||||
|
||||
@Test
|
||||
public void canConvertFromStringToArrayShouldReturnTrue() {
|
||||
assertThat(this.conversionService.canConvert(String.class, String[].class))
|
||||
|
||||
@@ -20,9 +20,7 @@ import java.util.Collection;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import org.junit.rules.ExpectedException;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.junit.runners.Parameterized;
|
||||
import org.junit.runners.Parameterized.Parameters;
|
||||
@@ -49,9 +47,6 @@ public class DelimitedStringToCollectionConverterTests {
|
||||
this.conversionService = conversionService;
|
||||
}
|
||||
|
||||
@Rule
|
||||
public ExpectedException thrown = ExpectedException.none();
|
||||
|
||||
@Test
|
||||
public void canConvertFromStringToCollectionShouldReturnTrue() {
|
||||
assertThat(this.conversionService.canConvert(String.class, Collection.class))
|
||||
|
||||
@@ -19,9 +19,7 @@ package org.springframework.boot.convert;
|
||||
import java.time.Duration;
|
||||
import java.time.temporal.ChronoUnit;
|
||||
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import org.junit.rules.ExpectedException;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.junit.runners.Parameterized;
|
||||
import org.junit.runners.Parameterized.Parameters;
|
||||
@@ -39,9 +37,6 @@ import static org.assertj.core.api.Assertions.assertThat;
|
||||
@RunWith(Parameterized.class)
|
||||
public class DurationToNumberConverterTests {
|
||||
|
||||
@Rule
|
||||
public ExpectedException thrown = ExpectedException.none();
|
||||
|
||||
private final ConversionService conversionService;
|
||||
|
||||
public DurationToNumberConverterTests(String name,
|
||||
|
||||
@@ -19,9 +19,7 @@ package org.springframework.boot.convert;
|
||||
import java.time.Duration;
|
||||
import java.time.temporal.ChronoUnit;
|
||||
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import org.junit.rules.ExpectedException;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.junit.runners.Parameterized;
|
||||
import org.junit.runners.Parameterized.Parameters;
|
||||
@@ -39,9 +37,6 @@ import static org.assertj.core.api.Assertions.assertThat;
|
||||
@RunWith(Parameterized.class)
|
||||
public class DurationToStringConverterTests {
|
||||
|
||||
@Rule
|
||||
public ExpectedException thrown = ExpectedException.none();
|
||||
|
||||
private final ConversionService conversionService;
|
||||
|
||||
public DurationToStringConverterTests(String name,
|
||||
|
||||
@@ -20,9 +20,7 @@ import java.time.Duration;
|
||||
import java.time.temporal.ChronoUnit;
|
||||
import java.util.Collections;
|
||||
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import org.junit.rules.ExpectedException;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.junit.runners.Parameterized;
|
||||
import org.junit.runners.Parameterized.Parameters;
|
||||
@@ -43,9 +41,6 @@ import static org.mockito.Mockito.mock;
|
||||
@RunWith(Parameterized.class)
|
||||
public class NumberToDurationConverterTests {
|
||||
|
||||
@Rule
|
||||
public ExpectedException thrown = ExpectedException.none();
|
||||
|
||||
private final ConversionService conversionService;
|
||||
|
||||
public NumberToDurationConverterTests(String name,
|
||||
|
||||
Reference in New Issue
Block a user