mirror of
https://github.com/elastic/elasticsearch.git
synced 2025-06-28 09:28:55 -04:00
Allow overriding blob container path in tests (#126391)
Some `AbstractBlobContainerRetriesTestCase#createBlobContainer` implementations choose a path for the container randomly, but we have a need for a test which re-creates the same container against a different `S3Service` and `BlobStore` and must therefore specify the same path each time. This commit exposes a parameter that lets callers specify a container path.
This commit is contained in:
parent
5dc7ab77b3
commit
fbbbdd7eec
4 changed files with 47 additions and 35 deletions
|
@ -29,6 +29,7 @@ import java.net.InetSocketAddress;
|
|||
import java.net.MalformedURLException;
|
||||
import java.net.SocketTimeoutException;
|
||||
import java.net.URL;
|
||||
import java.util.Objects;
|
||||
|
||||
import static org.hamcrest.Matchers.either;
|
||||
import static org.hamcrest.Matchers.instanceOf;
|
||||
|
@ -77,7 +78,8 @@ public class URLBlobContainerRetriesTests extends AbstractBlobContainerRetriesTe
|
|||
TimeValue readTimeout,
|
||||
Boolean disableChunkedEncoding,
|
||||
ByteSizeValue bufferSize,
|
||||
Integer maxBulkDeletes
|
||||
Integer maxBulkDeletes,
|
||||
BlobPath blobContainerPath
|
||||
) {
|
||||
Settings.Builder settingsBuilder = Settings.builder();
|
||||
|
||||
|
@ -98,7 +100,7 @@ public class URLBlobContainerRetriesTests extends AbstractBlobContainerRetriesTe
|
|||
factory.create(httpClientSettings),
|
||||
httpClientSettings
|
||||
);
|
||||
return urlBlobStore.blobContainer(BlobPath.EMPTY);
|
||||
return urlBlobStore.blobContainer(Objects.requireNonNullElse(blobContainerPath, BlobPath.EMPTY));
|
||||
} catch (MalformedURLException e) {
|
||||
throw new RuntimeException("Unable to create URLBlobStore", e);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue