mirror of
https://github.com/honeymoose/OpenSearch.git
synced 2025-03-01 16:39:11 +00:00
Tests: test GET/DELETE on non existing repo
`GET` and `DELETE` should return `404` error. Closes #28.
This commit is contained in:
parent
8ea9951e1a
commit
42706653e3
@ -296,6 +296,34 @@ public class AzureSnapshotRestoreITest extends AbstractAzureTest {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* For issue #28: https://github.com/elasticsearch/elasticsearch-cloud-azure/issues/28
|
||||
*/
|
||||
@Test
|
||||
public void testGetDeleteNonExistingSnapshot_28() throws StorageException, ServiceException, URISyntaxException {
|
||||
ClusterAdminClient client = client().admin().cluster();
|
||||
logger.info("--> creating azure repository without any path");
|
||||
PutRepositoryResponse putRepositoryResponse = client.preparePutRepository("test-repo").setType("azure")
|
||||
.setSettings(ImmutableSettings.settingsBuilder()
|
||||
.put(AzureStorageService.Fields.CONTAINER, getContainerName())
|
||||
).get();
|
||||
assertThat(putRepositoryResponse.isAcknowledged(), equalTo(true));
|
||||
|
||||
try {
|
||||
client.prepareGetSnapshots("test-repo").addSnapshots("nonexistingsnapshotname").get();
|
||||
fail("Shouldn't be here");
|
||||
} catch (SnapshotMissingException ex) {
|
||||
// Expected
|
||||
}
|
||||
|
||||
try {
|
||||
client.prepareDeleteSnapshot("test-repo", "nonexistingsnapshotname").get();
|
||||
fail("Shouldn't be here");
|
||||
} catch (SnapshotMissingException ex) {
|
||||
// Expected
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* For issue #21: https://github.com/elasticsearch/elasticsearch-cloud-azure/issues/21
|
||||
*/
|
||||
|
Loading…
x
Reference in New Issue
Block a user