Skip to content

Commit

Permalink
fix client tests mocks & style
Browse files Browse the repository at this point in the history
Signed-off-by: YANGDB <[email protected]>
  • Loading branch information
YANG-DB committed Oct 19, 2023
1 parent b3e2eb5 commit afd59b7
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ class FlintOpenSearchClientSuite extends AnyFlatSpec with OpenSearchSuite with M
val indexSettings = "{\"number_of_shards\": 3,\"number_of_replicas\": 2}"
val metadata = mock[FlintMetadata]
when(metadata.getContent(anyBoolean())).thenReturn("{}")
when(metadata.targetName).thenReturn(None)
when(metadata.indexSettings).thenReturn(Some(indexSettings))

flintClient.createIndex(indexName, metadata)
Expand All @@ -75,8 +76,9 @@ class FlintOpenSearchClientSuite extends AnyFlatSpec with OpenSearchSuite with M

it should "get all index metadata with the given index name pattern" in {
val metadata = mock[FlintMetadata]
when(metadata.getContent()).thenReturn("{}")
when(metadata.getContent(anyBoolean())).thenReturn("{}")
when(metadata.indexSettings).thenReturn(None)
when(metadata.targetName).thenReturn(None)
flintClient.createIndex("flint_test_1_index", metadata)
flintClient.createIndex("flint_test_2_index", metadata)

Expand Down

0 comments on commit afd59b7

Please sign in to comment.