Browse Source

Merge pull request #48620 from izeye

* pr/48620:
  Polish

Closes gh-48620
pull/48965/head
Stéphane Nicoll 3 months ago
parent
commit
acdbe045dd
  1. 6
      spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/cache/CacheCondition.java
  2. 2
      spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/mongo/MongoPropertiesTests.java
  3. 4
      spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/test/java/org/springframework/boot/buildpack/platform/docker/transport/HttpClientTransportTests.java
  4. 2
      spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/test/resources/org/springframework/boot/buildpack/platform/docker/transport/proxy-error.txt
  5. 4
      spring-boot-project/spring-boot/src/main/java/org/springframework/boot/json/JsonWriter.java

6
spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/cache/CacheCondition.java vendored

@ -40,10 +40,10 @@ class CacheCondition extends SpringBootCondition { @@ -40,10 +40,10 @@ class CacheCondition extends SpringBootCondition {
@Override
public ConditionOutcome getMatchOutcome(ConditionContext context, AnnotatedTypeMetadata metadata) {
Assert.isInstanceOf(AnnotationMetadata.class, metadata);
return extracted(context, (AnnotationMetadata) metadata);
return getOutcome(context, (AnnotationMetadata) metadata);
}
private ConditionOutcome extracted(ConditionContext context, AnnotationMetadata metadata) {
private ConditionOutcome getOutcome(ConditionContext context, AnnotationMetadata metadata) {
String sourceClass = metadata.getClassName();
ConditionMessage.Builder message = ConditionMessage.forCondition("Cache", sourceClass);
Environment environment = context.getEnvironment();
@ -52,7 +52,7 @@ class CacheCondition extends SpringBootCondition { @@ -52,7 +52,7 @@ class CacheCondition extends SpringBootCondition {
if (!specified.isBound()) {
return ConditionOutcome.match(message.because("automatic cache type"));
}
CacheType required = CacheConfigurations.getType(metadata.getClassName());
CacheType required = CacheConfigurations.getType(sourceClass);
if (specified.get() == required) {
return ConditionOutcome.match(message.because(specified.get() + " cache type"));
}

2
spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/mongo/MongoPropertiesTests.java

@ -31,7 +31,7 @@ import static org.assertj.core.api.Assertions.assertThat; @@ -31,7 +31,7 @@ import static org.assertj.core.api.Assertions.assertThat;
class MongoPropertiesTests {
@Test
void defaultUUidRepresentationIsAlignedWithSpringData() {
void defaultUuidRepresentationIsAlignedWithSpringData() {
UuidRepresentation springDataDefault = springDataDefaultUuidRepresentation();
UuidRepresentation springBootDefault = new MongoProperties().getUuidRepresentation();
assertThat(springBootDefault).isEqualTo(springDataDefault);

4
spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/test/java/org/springframework/boot/buildpack/platform/docker/transport/HttpClientTransportTests.java

@ -324,7 +324,7 @@ class HttpClientTransportTests { @@ -324,7 +324,7 @@ class HttpClientTransportTests {
}
@Test
void shouldReturnErrorsAndConentIfProxyAuthError() throws IOException {
void shouldReturnContentIfProxyAuthError() throws IOException {
givenClientWillReturnResponse();
given(this.entity.getContent()).willReturn(getClass().getResourceAsStream("proxy-error.txt"));
given(this.response.getCode()).willReturn(HttpStatus.SC_PROXY_AUTHENTICATION_REQUIRED);
@ -332,7 +332,7 @@ class HttpClientTransportTests { @@ -332,7 +332,7 @@ class HttpClientTransportTests {
.satisfies((ex) -> {
assertThat(ex.getErrors()).isNull();
assertThat(ex.getResponseMessage()).isNull();
assertThat(ex.getMessage()).contains("Some kind of procy auth problem!");
assertThat(ex.getMessage()).contains("Some kind of proxy auth problem!");
});
}

2
spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/test/resources/org/springframework/boot/buildpack/platform/docker/transport/proxy-error.txt

@ -1,2 +1,2 @@ @@ -1,2 +1,2 @@
Some kind of procy auth problem!
Some kind of proxy auth problem!

4
spring-boot-project/spring-boot/src/main/java/org/springframework/boot/json/JsonWriter.java

@ -304,7 +304,7 @@ public interface JsonWriter<T> { @@ -304,7 +304,7 @@ public interface JsonWriter<T> {
}
/**
* Add the a {@link NameProcessor} to be applied when the JSON is written.
* Add a {@link NameProcessor} to be applied when the JSON is written.
* @param nameProcessor the name processor to add
*/
public void applyingNameProcessor(NameProcessor nameProcessor) {
@ -313,7 +313,7 @@ public interface JsonWriter<T> { @@ -313,7 +313,7 @@ public interface JsonWriter<T> {
}
/**
* Add the a {@link ValueProcessor} to be applied when the JSON is written.
* Add a {@link ValueProcessor} to be applied when the JSON is written.
* @param valueProcessor the value processor to add
*/
public void applyingValueProcessor(ValueProcessor<?> valueProcessor) {

Loading…
Cancel
Save