[ML] remove duplicate code

Original commit: elastic/x-pack-elasticsearch@340480477c
This commit is contained in:
David Kyle 2017-02-22 13:52:38 +00:00
parent b233c4729d
commit f06b4fbbaf
2 changed files with 5 additions and 2 deletions

View File

@ -31,7 +31,6 @@ import org.elasticsearch.xpack.ml.job.config.Job;
import org.elasticsearch.xpack.ml.job.process.autodetect.AutodetectProcessManager;
import org.elasticsearch.xpack.ml.job.process.autodetect.params.InterimResultsParams;
import org.elasticsearch.xpack.ml.job.process.autodetect.params.TimeRange;
import org.elasticsearch.xpack.ml.utils.ExceptionsHelper;
import java.io.IOException;
import java.util.Objects;
@ -89,7 +88,7 @@ public class FlushJobAction extends Action<FlushJobAction.Request, FlushJobActio
}
public Request(String jobId) {
this.jobId = ExceptionsHelper.requireNonNull(jobId, Job.ID.getPreferredName());
super(jobId);
}
public boolean getCalcInterim() {

View File

@ -30,4 +30,8 @@ public class PostDataFlushRequestTests extends AbstractStreamableTestCase<Reques
protected Request createBlankInstance() {
return new Request();
}
public void testNullJobIdThrows() {
expectThrows(IllegalArgumentException.class, () -> new Request(null));
}
}