forked from opensearch-project/sql
-
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.
Add AsyncQueryRequestContext to QueryIdProvider parameter (opensearch…
…-project#2870) Signed-off-by: Tomoyuki Morita <[email protected]>
- Loading branch information
Showing
5 changed files
with
59 additions
and
14 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
35 changes: 35 additions & 0 deletions
35
.../test/java/org/opensearch/sql/spark/dispatcher/DatasourceEmbeddedQueryIdProviderTest.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,35 @@ | ||
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
package org.opensearch.sql.spark.dispatcher; | ||
|
||
import static org.junit.jupiter.api.Assertions.assertNotNull; | ||
import static org.mockito.Mockito.verifyNoInteractions; | ||
|
||
import org.junit.jupiter.api.Test; | ||
import org.junit.jupiter.api.extension.ExtendWith; | ||
import org.mockito.Mock; | ||
import org.mockito.junit.jupiter.MockitoExtension; | ||
import org.opensearch.sql.spark.asyncquery.model.AsyncQueryRequestContext; | ||
import org.opensearch.sql.spark.dispatcher.model.DispatchQueryRequest; | ||
|
||
@ExtendWith(MockitoExtension.class) | ||
class DatasourceEmbeddedQueryIdProviderTest { | ||
@Mock AsyncQueryRequestContext asyncQueryRequestContext; | ||
|
||
DatasourceEmbeddedQueryIdProvider datasourceEmbeddedQueryIdProvider = | ||
new DatasourceEmbeddedQueryIdProvider(); | ||
|
||
@Test | ||
public void test() { | ||
String queryId = | ||
datasourceEmbeddedQueryIdProvider.getQueryId( | ||
DispatchQueryRequest.builder().datasource("DATASOURCE").build(), | ||
asyncQueryRequestContext); | ||
|
||
assertNotNull(queryId); | ||
verifyNoInteractions(asyncQueryRequestContext); | ||
} | ||
} |