Skip to content

Commit

Permalink
overriding the textFieldType before every test
Browse files Browse the repository at this point in the history
Signed-off-by: Rishabh Maurya <[email protected]>
  • Loading branch information
rishabhmaurya committed Jan 2, 2024
1 parent 1907673 commit c04f89e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
import org.opensearch.index.query.QueryShardContext;
import org.opensearch.index.query.SourceFieldMatchQuery;
import org.opensearch.index.search.MatchQuery;
import org.junit.BeforeClass;
import org.junit.Before;

import java.io.IOException;
import java.util.HashMap;
Expand All @@ -42,8 +42,8 @@

public class MatchOnlyTextFieldMapperTests extends TextFieldMapperTests {

@BeforeClass
public static void beforeClass() {
@Before
public void setup() {
textFieldName = "match_only_text";
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@
import org.opensearch.index.query.MatchPhraseQueryBuilder;
import org.opensearch.index.query.QueryShardContext;
import org.opensearch.index.search.MatchQuery;
import org.junit.Before;

import java.io.IOException;
import java.util.Arrays;
Expand All @@ -95,7 +96,12 @@

public class TextFieldMapperTests extends MapperTestCase {

public static String textFieldName = "text";
public String textFieldName = "text";

@Before
public void setup() {
textFieldName = "text";
}

@Override
protected void writeFieldValue(XContentBuilder builder) throws IOException {
Expand Down

0 comments on commit c04f89e

Please sign in to comment.