File tree 3 files changed +3
-15
lines changed
internalClusterTest/java/org/opensearch/action/admin/indices/view
main/java/org/opensearch/action/admin/indices/view
test/java/org/opensearch/action/admin/indices/view
3 files changed +3
-15
lines changed Original file line number Diff line number Diff line change @@ -57,7 +57,7 @@ protected List<String> listViewNames() {
57
57
}
58
58
59
59
protected SearchResponse searchView (final String viewName ) throws Exception {
60
- final SearchViewAction .Request request = SearchViewAction .createRequestWith (viewName , new SearchRequest ());
60
+ final SearchViewAction .Request request = new SearchViewAction .Request (viewName , new SearchRequest ());
61
61
final SearchResponse response = client ().searchView (request ).actionGet ();
62
62
return response ;
63
63
}
Original file line number Diff line number Diff line change 16
16
import org .opensearch .action .support .HandledTransportAction ;
17
17
import org .opensearch .common .annotation .ExperimentalApi ;
18
18
import org .opensearch .common .inject .Inject ;
19
- import org .opensearch .common .io .stream .BytesStreamOutput ;
20
19
import org .opensearch .core .action .ActionListener ;
21
20
import org .opensearch .core .common .Strings ;
22
- import org .opensearch .core .common .io .stream .BytesStreamInput ;
23
21
import org .opensearch .core .common .io .stream .StreamInput ;
24
22
import org .opensearch .core .common .io .stream .StreamOutput ;
25
23
import org .opensearch .tasks .Task ;
@@ -42,16 +40,6 @@ private SearchViewAction() {
42
40
super (NAME , SearchResponse ::new );
43
41
}
44
42
45
- /** Given a search request, creates a ViewSearchRequest */
46
- public static Request createRequestWith (final String view , final SearchRequest searchRequest ) throws IOException {
47
- final BytesStreamOutput savedSearchRequest = new BytesStreamOutput ();
48
- searchRequest .writeTo (savedSearchRequest );
49
- savedSearchRequest .writeString (view );
50
-
51
- final BytesStreamInput input = new BytesStreamInput (savedSearchRequest .bytes ().toBytesRef ().bytes );
52
- return new Request (input );
53
- }
54
-
55
43
/**
56
44
* Wraps the functionality of search requests and tailors for what is available
57
45
* when searching through views
Original file line number Diff line number Diff line change @@ -30,14 +30,14 @@ protected Writeable.Reader<SearchViewAction.Request> instanceReader() {
30
30
@ Override
31
31
protected SearchViewAction .Request createTestInstance () {
32
32
try {
33
- return SearchViewAction .createRequestWith (randomAlphaOfLength (8 ), new SearchRequest ());
33
+ return new SearchViewAction .Request (randomAlphaOfLength (8 ), new SearchRequest ());
34
34
} catch (final Exception e ) {
35
35
throw new RuntimeException (e );
36
36
}
37
37
}
38
38
39
39
public void testValidateRequest () throws IOException {
40
- final SearchViewAction .Request request = SearchViewAction .createRequestWith ("my-view" , new SearchRequest ());
40
+ final SearchViewAction .Request request = new SearchViewAction .Request ("my-view" , new SearchRequest ());
41
41
MatcherAssert .assertThat (request .validate (), nullValue ());
42
42
}
43
43
You can’t perform that action at this time.
0 commit comments