Skip to content

Commit

Permalink
flint client builder test
Browse files Browse the repository at this point in the history
Signed-off-by: Sean Kao <[email protected]>
  • Loading branch information
seankao-az committed Jun 12, 2024
1 parent a1d6925 commit 4d8cba9
Showing 1 changed file with 29 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
/*
* Copyright OpenSearch Contributors
* SPDX-License-Identifier: Apache-2.0
*/

package org.opensearch.flint.core

import scala.collection.JavaConverters._

import org.opensearch.flint.OpenSearchSuite
import org.scalatest.flatspec.AnyFlatSpec
import org.scalatest.matchers.should.Matchers

class FlintClientBuilderSuite extends AnyFlatSpec with OpenSearchSuite with Matchers {

behavior of "Flint client builder"

it should "build flint client" in {
val flintClient = FlintClientBuilder.build(new FlintOptions(openSearchOptions.asJava))
flintClient shouldBe a[FlintClient]
}

it should "fail if cannot instantiate metadata log service" in {
val options = openSearchOptions + (FlintOptions.CUSTOM_FLINT_METADATA_LOG_SERVICE_CLASS -> "org.dummy.Class")
the[RuntimeException] thrownBy {
FlintClientBuilder.build(new FlintOptions(options.asJava))
}
}
}

0 comments on commit 4d8cba9

Please sign in to comment.