forked from elastic/elasticsearch
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'elastic/master' into pr/31285
* elastic/master: More detailed tracing when writing metadata (elastic#31319) [Tests] Mutualize fixtures code in BaseHttpFixture (elastic#31210) Remove RestGetAllAliasesAction (elastic#31308) Temporary fix for broken build Reenable Checkstyle's unused import rule (elastic#31270) Remove remaining unused imports before merging elastic#31270 Fix non-REST doc snippet
- Loading branch information
Showing
50 changed files
with
1,672 additions
and
2,276 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
53 changes: 53 additions & 0 deletions
53
...ples/rest-handler/src/test/java/org/elasticsearch/example/resthandler/ExampleFixture.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
/* | ||
* Licensed to Elasticsearch under one or more contributor | ||
* license agreements. See the NOTICE file distributed with | ||
* this work for additional information regarding copyright | ||
* ownership. Elasticsearch licenses this file to you under | ||
* the Apache License, Version 2.0 (the "License"); you may | ||
* not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, | ||
* software distributed under the License is distributed on an | ||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
* KIND, either express or implied. See the License for the | ||
* specific language governing permissions and limitations | ||
* under the License. | ||
*/ | ||
package org.elasticsearch.example.resthandler; | ||
|
||
import org.elasticsearch.test.fixture.AbstractHttpFixture; | ||
|
||
import java.io.IOException; | ||
import java.util.Objects; | ||
|
||
import static java.nio.charset.StandardCharsets.UTF_8; | ||
|
||
public class ExampleFixture extends AbstractHttpFixture { | ||
|
||
private final String message; | ||
|
||
private ExampleFixture(final String workingDir, final String message) { | ||
super(workingDir); | ||
this.message = Objects.requireNonNull(message); | ||
} | ||
|
||
@Override | ||
protected Response handle(final Request request) throws IOException { | ||
if ("GET".equals(request.getMethod()) && "/".equals(request.getPath())) { | ||
return new Response(200, TEXT_PLAIN_CONTENT_TYPE, message.getBytes(UTF_8)); | ||
} | ||
return null; | ||
} | ||
|
||
public static void main(final String[] args) throws Exception { | ||
if (args == null || args.length != 2) { | ||
throw new IllegalArgumentException("ExampleFixture <working directory> <echo message>"); | ||
} | ||
|
||
final ExampleFixture fixture = new ExampleFixture(args[0], args[1]); | ||
fixture.listen(); | ||
} | ||
} |
Oops, something went wrong.