forked from opensearch-project/OpenSearch
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Signed-off-by: Uriel Dan Nudelman <[email protected]>
- Loading branch information
Showing
7 changed files
with
116 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 36 additions & 0 deletions
36
...-client/src/test/java/org/opensearch/client/opensearch/core/DeleteByQueryRequestTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
/* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
* | ||
* The OpenSearch Contributors require contributions made to | ||
* this file be licensed under the Apache-2.0 license or a | ||
* compatible open source license. | ||
*/ | ||
|
||
package org.opensearch.client.opensearch.core; | ||
|
||
import org.junit.Assert; | ||
import org.junit.Test; | ||
|
||
import java.util.Map; | ||
|
||
public class DeleteByQueryRequestTest extends Assert { | ||
@Test | ||
public void testEndpointSlicesAuto() { | ||
DeleteByQueryRequest deleteByQueryRequest = DeleteByQueryRequest.of(b -> b | ||
.index("test-index") | ||
.slices(0L)); | ||
Map<String, String> queryParameters = DeleteByQueryRequest._ENDPOINT.queryParameters(deleteByQueryRequest); | ||
assertTrue("Must have a slices query parameter", queryParameters.containsKey("slices")); | ||
assertEquals("auto", queryParameters.get("slices")); | ||
} | ||
|
||
@Test | ||
public void DeleteByQueryRequest() { | ||
DeleteByQueryRequest deleteByQueryRequest = DeleteByQueryRequest.of(b -> b | ||
.index("test-index") | ||
.slices(6L)); | ||
Map<String, String> queryParameters = DeleteByQueryRequest._ENDPOINT.queryParameters(deleteByQueryRequest); | ||
assertTrue("Must have a slices query parameter", queryParameters.containsKey("slices")); | ||
assertEquals("6", queryParameters.get("slices")); | ||
} | ||
} |
34 changes: 34 additions & 0 deletions
34
java-client/src/test/java/org/opensearch/client/opensearch/core/ReindexRequestTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
/* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
* | ||
* The OpenSearch Contributors require contributions made to | ||
* this file be licensed under the Apache-2.0 license or a | ||
* compatible open source license. | ||
*/ | ||
|
||
package org.opensearch.client.opensearch.core; | ||
|
||
import org.junit.Assert; | ||
import org.junit.Test; | ||
|
||
import java.util.Map; | ||
|
||
public class ReindexRequestTest extends Assert { | ||
@Test | ||
public void testEndpointSlicesAuto() { | ||
ReindexRequest reindexRequest = ReindexRequest.of(b -> b | ||
.slices(0L)); | ||
Map<String, String> queryParameters = ReindexRequest._ENDPOINT.queryParameters(reindexRequest); | ||
assertTrue("Must have a slices query parameter", queryParameters.containsKey("slices")); | ||
assertEquals("auto", queryParameters.get("slices")); | ||
} | ||
|
||
@Test | ||
public void testEndpointSlicesNumber() { | ||
ReindexRequest reindexRequest = ReindexRequest.of(b -> b | ||
.slices(6L)); | ||
Map<String, String> queryParameters = ReindexRequest._ENDPOINT.queryParameters(reindexRequest); | ||
assertTrue("Must have a slices query parameter", queryParameters.containsKey("slices")); | ||
assertEquals("6", queryParameters.get("slices")); | ||
} | ||
} |
36 changes: 36 additions & 0 deletions
36
...-client/src/test/java/org/opensearch/client/opensearch/core/UpdateByQueryRequestTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
/* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
* | ||
* The OpenSearch Contributors require contributions made to | ||
* this file be licensed under the Apache-2.0 license or a | ||
* compatible open source license. | ||
*/ | ||
|
||
package org.opensearch.client.opensearch.core; | ||
|
||
import org.junit.Assert; | ||
import org.junit.Test; | ||
|
||
import java.util.Map; | ||
|
||
public class UpdateByQueryRequestTest extends Assert { | ||
@Test | ||
public void testEndpointSlicesAuto() { | ||
UpdateByQueryRequest updateByQueryRequest = UpdateByQueryRequest.of(b -> b | ||
.index("test-index") | ||
.slices(0L)); | ||
Map<String, String> queryParameters = UpdateByQueryRequest._ENDPOINT.queryParameters(updateByQueryRequest); | ||
assertTrue("Must have a slices query parameter", queryParameters.containsKey("slices")); | ||
assertEquals("auto", queryParameters.get("slices")); | ||
} | ||
|
||
@Test | ||
public void testEndpointSlicesNumber() { | ||
UpdateByQueryRequest updateByQueryRequest = UpdateByQueryRequest.of(b -> b | ||
.index("test-index") | ||
.slices(6L)); | ||
Map<String, String> queryParameters = UpdateByQueryRequest._ENDPOINT.queryParameters(updateByQueryRequest); | ||
assertTrue("Must have a slices query parameter", queryParameters.containsKey("slices")); | ||
assertEquals("6", queryParameters.get("slices")); | ||
} | ||
} |