Skip to content

Commit

Permalink
Add missing test
Browse files Browse the repository at this point in the history
Signed-off-by: Tomoyuki Morita <[email protected]>
  • Loading branch information
ykmr1224 committed Apr 29, 2024
1 parent bbed24a commit 986cbc7
Showing 1 changed file with 45 additions and 0 deletions.
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());
}
}

0 comments on commit 986cbc7

Please sign in to comment.