-
Notifications
You must be signed in to change notification settings - Fork 141
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Tomoyuki Morita <[email protected]>
- Loading branch information
Showing
1 changed file
with
45 additions
and
0 deletions.
There are no files selected for viewing
45 changes: 45 additions & 0 deletions
45
spark/src/test/java/org/opensearch/sql/spark/helper/FlintHelperTest.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,45 @@ | ||
package org.opensearch.sql.spark.helper; | ||
|
||
import static org.opensearch.sql.spark.data.constants.SparkConstants.FLINT_DEFAULT_AUTH; | ||
import static org.opensearch.sql.spark.data.constants.SparkConstants.FLINT_DEFAULT_HOST; | ||
import static org.opensearch.sql.spark.data.constants.SparkConstants.FLINT_DEFAULT_PORT; | ||
import static org.opensearch.sql.spark.data.constants.SparkConstants.FLINT_DEFAULT_REGION; | ||
import static org.opensearch.sql.spark.data.constants.SparkConstants.FLINT_DEFAULT_SCHEME; | ||
import static org.opensearch.sql.spark.data.constants.SparkConstants.FLINT_INTEGRATION_JAR; | ||
|
||
import org.junit.jupiter.api.Assertions; | ||
import org.junit.jupiter.api.Test; | ||
|
||
class FlintHelperTest { | ||
|
||
private static final String JAR = "JAR"; | ||
private static final String HOST = "HOST"; | ||
private static final String PORT = "PORT"; | ||
private static final String SCHEME = "SCHEME"; | ||
private static final String AUTH = "AUTH"; | ||
private static final String REGION = "REGION"; | ||
|
||
@Test | ||
public void testConstructorWithNull() { | ||
FlintHelper helper = new FlintHelper(null, null, null, null, null, null); | ||
|
||
Assertions.assertEquals(FLINT_INTEGRATION_JAR, helper.getFlintIntegrationJar()); | ||
Assertions.assertEquals(FLINT_DEFAULT_HOST, helper.getFlintHost()); | ||
Assertions.assertEquals(FLINT_DEFAULT_PORT, helper.getFlintPort()); | ||
Assertions.assertEquals(FLINT_DEFAULT_SCHEME, helper.getFlintScheme()); | ||
Assertions.assertEquals(FLINT_DEFAULT_AUTH, helper.getFlintAuth()); | ||
Assertions.assertEquals(FLINT_DEFAULT_REGION, helper.getFlintRegion()); | ||
} | ||
|
||
@Test | ||
public void testConstructor() { | ||
FlintHelper helper = new FlintHelper(JAR, HOST, PORT, SCHEME, AUTH, REGION); | ||
|
||
Assertions.assertEquals(JAR, helper.getFlintIntegrationJar()); | ||
Assertions.assertEquals(HOST, helper.getFlintHost()); | ||
Assertions.assertEquals(PORT, helper.getFlintPort()); | ||
Assertions.assertEquals(SCHEME, helper.getFlintScheme()); | ||
Assertions.assertEquals(AUTH, helper.getFlintAuth()); | ||
Assertions.assertEquals(REGION, helper.getFlintRegion()); | ||
} | ||
} |