-
Notifications
You must be signed in to change notification settings - Fork 24.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ML] Put ML filter API response should contain the filter (#31362)
- Loading branch information
1 parent
dbc9d60
commit c6a5a6d
Showing
7 changed files
with
100 additions
and
15 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
31 changes: 31 additions & 0 deletions
31
...re/src/test/java/org/elasticsearch/xpack/core/ml/action/PutFilterActionResponseTests.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,31 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License; | ||
* you may not use this file except in compliance with the Elastic License. | ||
*/ | ||
package org.elasticsearch.xpack.core.ml.action; | ||
|
||
import org.elasticsearch.common.xcontent.XContentParser; | ||
import org.elasticsearch.test.AbstractStreamableXContentTestCase; | ||
import org.elasticsearch.xpack.core.ml.job.config.MlFilter; | ||
import org.elasticsearch.xpack.core.ml.job.config.MlFilterTests; | ||
|
||
import java.io.IOException; | ||
|
||
public class PutFilterActionResponseTests extends AbstractStreamableXContentTestCase<PutFilterAction.Response> { | ||
|
||
@Override | ||
protected PutFilterAction.Response createTestInstance() { | ||
return new PutFilterAction.Response(MlFilterTests.createRandom()); | ||
} | ||
|
||
@Override | ||
protected PutFilterAction.Response createBlankInstance() { | ||
return new PutFilterAction.Response(); | ||
} | ||
|
||
@Override | ||
protected PutFilterAction.Response doParseInstance(XContentParser parser) throws IOException { | ||
return new PutFilterAction.Response(MlFilter.LENIENT_PARSER.parse(parser, null).build()); | ||
} | ||
} |
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