From c1b864c826bca8ed7a8b7619a40adfaba935440e Mon Sep 17 00:00:00 2001 From: Andy Wilkinson Date: Tue, 18 Sep 2018 11:18:28 +0100 Subject: [PATCH] Polish --- .../rest/RestClientAutoConfigurationTests.java | 6 ++++-- .../cli/compiler/grape/DetailedProgressReporterTests.java | 4 ++-- .../boot/gradle/tasks/bundling/BootZipCopyAction.java | 1 + .../boot/testsupport/testcontainers/Container.java | 4 +++- 4 files changed, 10 insertions(+), 5 deletions(-) diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/elasticsearch/rest/RestClientAutoConfigurationTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/elasticsearch/rest/RestClientAutoConfigurationTests.java index 1fe8e2f722..6b367255ef 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/elasticsearch/rest/RestClientAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/elasticsearch/rest/RestClientAutoConfigurationTests.java @@ -22,6 +22,7 @@ import java.util.Map; import org.elasticsearch.action.get.GetRequest; import org.elasticsearch.action.index.IndexRequest; +import org.elasticsearch.client.RequestOptions; import org.elasticsearch.client.RestClient; import org.elasticsearch.client.RestHighLevelClient; import org.junit.Test; @@ -87,9 +88,10 @@ public class RestClientAutoConfigurationTests { source.put("b", "bravo"); IndexRequest index = new IndexRequest("foo", "bar", "1") .source(source); - client.index(index); + client.index(index, RequestOptions.DEFAULT); GetRequest getRequest = new GetRequest("foo", "bar", "1"); - assertThat(client.get(getRequest).isExists()).isTrue(); + assertThat(client.get(getRequest, RequestOptions.DEFAULT).isExists()) + .isTrue(); })); } diff --git a/spring-boot-project/spring-boot-cli/src/test/java/org/springframework/boot/cli/compiler/grape/DetailedProgressReporterTests.java b/spring-boot-project/spring-boot-cli/src/test/java/org/springframework/boot/cli/compiler/grape/DetailedProgressReporterTests.java index c4d6834b91..d5b2a349be 100644 --- a/spring-boot-project/spring-boot-cli/src/test/java/org/springframework/boot/cli/compiler/grape/DetailedProgressReporterTests.java +++ b/spring-boot-project/spring-boot-cli/src/test/java/org/springframework/boot/cli/compiler/grape/DetailedProgressReporterTests.java @@ -39,8 +39,8 @@ public final class DetailedProgressReporterTests { private static final String ARTIFACT = "org/alpha/bravo/charlie/1.2.3/charlie-1.2.3.jar"; - private final TransferResource resource = new TransferResource(REPOSITORY, ARTIFACT, - null, null); + private final TransferResource resource = new TransferResource(null, REPOSITORY, + ARTIFACT, null, null); private final ByteArrayOutputStream baos = new ByteArrayOutputStream(); diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/java/org/springframework/boot/gradle/tasks/bundling/BootZipCopyAction.java b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/java/org/springframework/boot/gradle/tasks/bundling/BootZipCopyAction.java index b7b6e3a844..416a44fe4a 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/java/org/springframework/boot/gradle/tasks/bundling/BootZipCopyAction.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/java/org/springframework/boot/gradle/tasks/bundling/BootZipCopyAction.java @@ -119,6 +119,7 @@ class BootZipCopyAction implements CopyAction { return () -> true; } + @SuppressWarnings("unchecked") private Spec createExclusionSpec( Spec loaderEntries) { return Specs.union(loaderEntries, this.exclusions); diff --git a/spring-boot-project/spring-boot-tools/spring-boot-test-support/src/main/java/org/springframework/boot/testsupport/testcontainers/Container.java b/spring-boot-project/spring-boot-tools/spring-boot-test-support/src/main/java/org/springframework/boot/testsupport/testcontainers/Container.java index c60b2393a2..3c2f5dea47 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-test-support/src/main/java/org/springframework/boot/testsupport/testcontainers/Container.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-test-support/src/main/java/org/springframework/boot/testsupport/testcontainers/Container.java @@ -24,6 +24,7 @@ import org.junit.rules.TestRule; import org.junit.runner.Description; import org.junit.runners.model.Statement; import org.testcontainers.DockerClientFactory; +import org.testcontainers.containers.FailureDetectingExternalResource; import org.testcontainers.containers.GenericContainer; /** @@ -68,7 +69,8 @@ class Container implements TestRule { return new SkipStatement(); } this.container = this.containerFactory.get(); - return this.container.apply(base, description); + return ((FailureDetectingExternalResource) this.container).apply(base, + description); } public int getMappedPort() {