From b67ece48e445bf01fe65ffceef2440b6932428a1 Mon Sep 17 00:00:00 2001 From: Johnny Lim Date: Tue, 4 Feb 2020 00:20:06 +0900 Subject: [PATCH 1/2] Polish See gh-20020 --- .../artifactory/ArtifactoryServiceTests.java | 20 +++++++++---------- .../actuate/health/CompositeHealthTests.java | 4 ++-- .../actuate/health/SystemHealthTests.java | 2 +- .../cache/CacheAutoConfiguration.java | 2 +- .../orm/jpa/HibernateJpaConfiguration.java | 3 +-- .../boot/cli/JarCommandIT.java | 4 ++-- ...fiedClassPathExtensionExclusionsTests.java | 2 +- 7 files changed, 18 insertions(+), 19 deletions(-) diff --git a/ci/images/releasescripts/src/test/java/io/spring/concourse/releasescripts/artifactory/ArtifactoryServiceTests.java b/ci/images/releasescripts/src/test/java/io/spring/concourse/releasescripts/artifactory/ArtifactoryServiceTests.java index d0b8a2b34d..0f321e762b 100644 --- a/ci/images/releasescripts/src/test/java/io/spring/concourse/releasescripts/artifactory/ArtifactoryServiceTests.java +++ b/ci/images/releasescripts/src/test/java/io/spring/concourse/releasescripts/artifactory/ArtifactoryServiceTests.java @@ -76,7 +76,7 @@ class ArtifactoryServiceTests { void promoteWhenSuccessful() { this.server .expect(requestTo( - "https://repo.spring.io/api/build/promote/" + "example-build" + "/" + "example-build-1")) + "https://repo.spring.io/api/build/promote/example-build/example-build-1")) .andExpect(method(HttpMethod.POST)) .andExpect(content().json( "{\"status\": \"staged\", \"sourceRepo\": \"libs-staging-local\", \"targetRepo\": \"libs-milestone-local\"}")) @@ -91,9 +91,9 @@ class ArtifactoryServiceTests { void promoteWhenArtifactsAlreadyPromoted() { this.server .expect(requestTo( - "https://repo.spring.io/api/build/promote/" + "example-build" + "/" + "example-build-1")) + "https://repo.spring.io/api/build/promote/example-build/example-build-1")) .andRespond(withStatus(HttpStatus.CONFLICT)); - this.server.expect(requestTo("https://repo.spring.io/api/build/" + "example-build" + "/" + "example-build-1")) + this.server.expect(requestTo("https://repo.spring.io/api/build/example-build/example-build-1")) .andRespond(withJsonFrom("build-info-response.json")); this.service.promote("libs-release-local", getReleaseInfo()); this.server.verify(); @@ -103,9 +103,9 @@ class ArtifactoryServiceTests { void promoteWhenCheckForArtifactsAlreadyPromotedFails() { this.server .expect(requestTo( - "https://repo.spring.io/api/build/promote/" + "example-build" + "/" + "example-build-1")) + "https://repo.spring.io/api/build/promote/example-build/example-build-1")) .andRespond(withStatus(HttpStatus.CONFLICT)); - this.server.expect(requestTo("https://repo.spring.io/api/build/" + "example-build" + "/" + "example-build-1")) + this.server.expect(requestTo("https://repo.spring.io/api/build/example-build/example-build-1")) .andRespond(withStatus(HttpStatus.FORBIDDEN)); assertThatExceptionOfType(HttpClientErrorException.class) .isThrownBy(() -> this.service.promote("libs-release-local", getReleaseInfo())); @@ -116,9 +116,9 @@ class ArtifactoryServiceTests { void promoteWhenPromotionFails() { this.server .expect(requestTo( - "https://repo.spring.io/api/build/promote/" + "example-build" + "/" + "example-build-1")) + "https://repo.spring.io/api/build/promote/example-build/example-build-1")) .andRespond(withStatus(HttpStatus.CONFLICT)); - this.server.expect(requestTo("https://repo.spring.io/api/build/" + "example-build" + "/" + "example-build-1")) + this.server.expect(requestTo("https://repo.spring.io/api/build/example-build/example-build-1")) .andRespond(withJsonFrom("staged-build-info-response.json")); assertThatExceptionOfType(HttpClientErrorException.class) .isThrownBy(() -> this.service.promote("libs-release-local", getReleaseInfo())); @@ -131,7 +131,7 @@ class ArtifactoryServiceTests { given(this.bintrayService.isDistributionComplete(releaseInfo)).willReturn(true); this.server .expect(requestTo( - "https://repo.spring.io/api/build/distribute/" + "example-build" + "/" + "example-build-1")) + "https://repo.spring.io/api/build/distribute/example-build/example-build-1")) .andExpect(method(HttpMethod.POST)) .andExpect(content().json( "{\"sourceRepos\": [\"libs-release-local\"], \"targetRepo\" : \"spring-distributions\", \"async\":\"true\"}")) @@ -148,7 +148,7 @@ class ArtifactoryServiceTests { ReleaseInfo releaseInfo = getReleaseInfo(); this.server .expect(requestTo( - "https://repo.spring.io/api/build/distribute/" + "example-build" + "/" + "example-build-1")) + "https://repo.spring.io/api/build/distribute/example-build/example-build-1")) .andExpect(method(HttpMethod.POST)) .andExpect(content().json( "{\"sourceRepos\": [\"libs-release-local\"], \"targetRepo\" : \"spring-distributions\", \"async\":\"true\"}")) @@ -168,7 +168,7 @@ class ArtifactoryServiceTests { given(this.bintrayService.isDistributionComplete(releaseInfo)).willReturn(false); this.server .expect(requestTo( - "https://repo.spring.io/api/build/distribute/" + "example-build" + "/" + "example-build-1")) + "https://repo.spring.io/api/build/distribute/example-build/example-build-1")) .andExpect(method(HttpMethod.POST)) .andExpect(content().json( "{\"sourceRepos\": [\"libs-release-local\"], \"targetRepo\" : \"spring-distributions\", \"async\":\"true\"}")) diff --git a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/health/CompositeHealthTests.java b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/health/CompositeHealthTests.java index ec4e1ee3be..3d0c25528c 100644 --- a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/health/CompositeHealthTests.java +++ b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/health/CompositeHealthTests.java @@ -64,7 +64,7 @@ class CompositeHealthTests { CompositeHealth health = new CompositeHealth(ApiVersion.V3, Status.UP, components); ObjectMapper mapper = new ObjectMapper(); String json = mapper.writeValueAsString(health); - assertThat(json).isEqualTo("{\"status\":\"UP\",\"components\":{" + "\"db1\":{\"status\":\"UP\"}," + assertThat(json).isEqualTo("{\"status\":\"UP\",\"components\":{\"db1\":{\"status\":\"UP\"}," + "\"db2\":{\"status\":\"DOWN\",\"details\":{\"a\":\"b\"}}}}"); } @@ -76,7 +76,7 @@ class CompositeHealthTests { CompositeHealth health = new CompositeHealth(ApiVersion.V2, Status.UP, components); ObjectMapper mapper = new ObjectMapper(); String json = mapper.writeValueAsString(health); - assertThat(json).isEqualTo("{\"status\":\"UP\",\"details\":{" + "\"db1\":{\"status\":\"UP\"}," + assertThat(json).isEqualTo("{\"status\":\"UP\",\"details\":{\"db1\":{\"status\":\"UP\"}," + "\"db2\":{\"status\":\"DOWN\",\"details\":{\"a\":\"b\"}}}}"); } diff --git a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/health/SystemHealthTests.java b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/health/SystemHealthTests.java index 45eafce64e..9ed39811a7 100644 --- a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/health/SystemHealthTests.java +++ b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/health/SystemHealthTests.java @@ -45,7 +45,7 @@ class SystemHealthTests { CompositeHealth health = new SystemHealth(ApiVersion.V3, Status.UP, components, groups); ObjectMapper mapper = new ObjectMapper(); String json = mapper.writeValueAsString(health); - assertThat(json).isEqualTo("{\"status\":\"UP\",\"components\":{" + "\"db1\":{\"status\":\"UP\"}," + assertThat(json).isEqualTo("{\"status\":\"UP\",\"components\":{\"db1\":{\"status\":\"UP\"}," + "\"db2\":{\"status\":\"DOWN\",\"details\":{\"a\":\"b\"}}}," + "\"groups\":[\"liveness\",\"readiness\"]}"); } diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/cache/CacheAutoConfiguration.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/cache/CacheAutoConfiguration.java index 108bac9fa9..cbc6adec3b 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/cache/CacheAutoConfiguration.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/cache/CacheAutoConfiguration.java @@ -107,7 +107,7 @@ public class CacheAutoConfiguration { @Override public void afterPropertiesSet() { Assert.notNull(this.cacheManager.getIfAvailable(), - () -> "No cache manager could be auto-configured, check your configuration (caching " + "type is '" + () -> "No cache manager could be auto-configured, check your configuration (caching type is '" + this.cacheProperties.getType() + "')"); } diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/orm/jpa/HibernateJpaConfiguration.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/orm/jpa/HibernateJpaConfiguration.java index 0e9d993831..58fc17d21e 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/orm/jpa/HibernateJpaConfiguration.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/orm/jpa/HibernateJpaConfiguration.java @@ -183,8 +183,7 @@ class HibernateJpaConfiguration extends JpaBaseConfiguration { // containers (e.g. JBoss EAP 6) wrap it in the superclass LinkageError if (!isUsingJndi()) { throw new IllegalStateException( - "Unable to set Hibernate JTA platform, are you using the correct " + "version of Hibernate?", - ex); + "Unable to set Hibernate JTA platform, are you using the correct version of Hibernate?", ex); } // Assume that Hibernate will use JNDI if (logger.isDebugEnabled()) { diff --git a/spring-boot-project/spring-boot-cli/src/intTest/java/org/springframework/boot/cli/JarCommandIT.java b/spring-boot-project/spring-boot-cli/src/intTest/java/org/springframework/boot/cli/JarCommandIT.java index 0493c67394..5bb7857ead 100644 --- a/spring-boot-project/spring-boot-cli/src/intTest/java/org/springframework/boot/cli/JarCommandIT.java +++ b/spring-boot-project/spring-boot-cli/src/intTest/java/org/springframework/boot/cli/JarCommandIT.java @@ -55,7 +55,7 @@ class JarCommandIT { invocation.await(); assertThat(invocation.getStandardOutput()).isEqualTo(""); assertThat(invocation.getErrorOutput()) - .contains("The name of the " + "resulting jar and at least one source file must be specified"); + .contains("The name of the resulting jar and at least one source file must be specified"); } @Test @@ -64,7 +64,7 @@ class JarCommandIT { invocation.await(); assertThat(invocation.getStandardOutput()).isEqualTo(""); assertThat(invocation.getErrorOutput()) - .contains("The name of the " + "resulting jar and at least one source file must be specified"); + .contains("The name of the resulting jar and at least one source file must be specified"); } @Test diff --git a/spring-boot-project/spring-boot-tools/spring-boot-test-support/src/test/java/org/springframework/boot/testsupport/classpath/ModifiedClassPathExtensionExclusionsTests.java b/spring-boot-project/spring-boot-tools/spring-boot-test-support/src/test/java/org/springframework/boot/testsupport/classpath/ModifiedClassPathExtensionExclusionsTests.java index 25e7206f27..a68eeb1358 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-test-support/src/test/java/org/springframework/boot/testsupport/classpath/ModifiedClassPathExtensionExclusionsTests.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-test-support/src/test/java/org/springframework/boot/testsupport/classpath/ModifiedClassPathExtensionExclusionsTests.java @@ -30,7 +30,7 @@ import static org.hamcrest.Matchers.isA; @ClassPathExclusions("hibernate-validator-*.jar") class ModifiedClassPathExtensionExclusionsTests { - private static final String EXCLUDED_RESOURCE = "META-INF/services/" + "javax.validation.spi.ValidationProvider"; + private static final String EXCLUDED_RESOURCE = "META-INF/services/javax.validation.spi.ValidationProvider"; @Test void entriesAreFilteredFromTestClassClassLoader() { From b5e23e7405d3cae09cc917217dace78a760a0ec9 Mon Sep 17 00:00:00 2001 From: Stephane Nicoll Date: Mon, 3 Feb 2020 17:39:40 +0100 Subject: [PATCH 2/2] Update copyright year of changed files See gh-20020 --- .../boot/actuate/health/CompositeHealthTests.java | 2 +- .../springframework/boot/actuate/health/SystemHealthTests.java | 2 +- .../boot/autoconfigure/cache/CacheAutoConfiguration.java | 2 +- .../boot/autoconfigure/orm/jpa/HibernateJpaConfiguration.java | 2 +- .../classpath/ModifiedClassPathExtensionExclusionsTests.java | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/health/CompositeHealthTests.java b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/health/CompositeHealthTests.java index 3d0c25528c..3bdb8a02d7 100644 --- a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/health/CompositeHealthTests.java +++ b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/health/CompositeHealthTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * Copyright 2012-2020 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/health/SystemHealthTests.java b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/health/SystemHealthTests.java index 9ed39811a7..0d38769673 100644 --- a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/health/SystemHealthTests.java +++ b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/health/SystemHealthTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * Copyright 2012-2020 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/cache/CacheAutoConfiguration.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/cache/CacheAutoConfiguration.java index cbc6adec3b..c8a9e67010 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/cache/CacheAutoConfiguration.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/cache/CacheAutoConfiguration.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * Copyright 2012-2020 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/orm/jpa/HibernateJpaConfiguration.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/orm/jpa/HibernateJpaConfiguration.java index 58fc17d21e..b54a8504d7 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/orm/jpa/HibernateJpaConfiguration.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/orm/jpa/HibernateJpaConfiguration.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * Copyright 2012-2020 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/spring-boot-project/spring-boot-tools/spring-boot-test-support/src/test/java/org/springframework/boot/testsupport/classpath/ModifiedClassPathExtensionExclusionsTests.java b/spring-boot-project/spring-boot-tools/spring-boot-test-support/src/test/java/org/springframework/boot/testsupport/classpath/ModifiedClassPathExtensionExclusionsTests.java index a68eeb1358..dba1a03e77 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-test-support/src/test/java/org/springframework/boot/testsupport/classpath/ModifiedClassPathExtensionExclusionsTests.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-test-support/src/test/java/org/springframework/boot/testsupport/classpath/ModifiedClassPathExtensionExclusionsTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * Copyright 2012-2020 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License.