fixed integration tests due to upstream changes

Original commit: elastic/x-pack-elasticsearch@e6bf9bb4a1
This commit is contained in:
Martijn van Groningen 2017-01-09 12:03:14 +01:00
parent 8e6aa2ba3d
commit ade3f6f207
16 changed files with 51 additions and 11 deletions

View File

@ -355,7 +355,10 @@ public class GetBucketsAction extends Action<GetBucketsAction.Request, GetBucket
@Override
public XContentBuilder toXContent(XContentBuilder builder, Params params) throws IOException {
return buckets.doXContentBody(builder, params);
builder.startObject();
buckets.doXContentBody(builder, params);
builder.endObject();
return builder;
}
@Override

View File

@ -212,7 +212,9 @@ Action<GetCategoriesDefinitionAction.Request, GetCategoriesDefinitionAction.Resp
@Override
public XContentBuilder toXContent(XContentBuilder builder, Params params) throws IOException {
builder.startObject();
result.doXContentBody(builder, params);
builder.endObject();
return builder;
}

View File

@ -270,7 +270,10 @@ extends Action<GetInfluencersAction.Request, GetInfluencersAction.Response, GetI
@Override
public XContentBuilder toXContent(XContentBuilder builder, Params params) throws IOException {
return influencers.doXContentBody(builder, params);
builder.startObject();
influencers.doXContentBody(builder, params);
builder.endObject();
return builder;
}
@Override

View File

@ -140,7 +140,10 @@ public class GetJobsAction extends Action<GetJobsAction.Request, GetJobsAction.R
@Override
public XContentBuilder toXContent(XContentBuilder builder, Params params) throws IOException {
return jobs.doXContentBody(builder, params);
builder.startObject();
jobs.doXContentBody(builder, params);
builder.endObject();
return builder;
}
@Override

View File

@ -242,7 +242,10 @@ public class GetJobsStatsAction extends Action<GetJobsStatsAction.Request, GetJo
@Override
public XContentBuilder toXContent(XContentBuilder builder, Params params) throws IOException {
return jobsStats.doXContentBody(builder, params);
builder.startObject();;
jobsStats.doXContentBody(builder, params);
builder.endObject();
return builder;
}
@Override

View File

@ -188,7 +188,10 @@ public class GetListAction extends Action<GetListAction.Request, GetListAction.R
@Override
public XContentBuilder toXContent(XContentBuilder builder, Params params) throws IOException {
return lists.doXContentBody(builder, params);
builder.startObject();
lists.doXContentBody(builder, params);
builder.endObject();
return builder;
}
@Override

View File

@ -260,7 +260,10 @@ extends Action<GetModelSnapshotsAction.Request, GetModelSnapshotsAction.Response
@Override
public XContentBuilder toXContent(XContentBuilder builder, Params params) throws IOException {
return page.doXContentBody(builder, params);
builder.startObject();
page.doXContentBody(builder, params);
builder.endObject();
return builder;
}
@Override

View File

@ -305,7 +305,10 @@ public class GetRecordsAction extends Action<GetRecordsAction.Request, GetRecord
@Override
public XContentBuilder toXContent(XContentBuilder builder, Params params) throws IOException {
return records.doXContentBody(builder, params);
builder.startObject();
records.doXContentBody(builder, params);
builder.endObject();
return builder;
}
@Override

View File

@ -152,7 +152,10 @@ public class GetSchedulersAction extends Action<GetSchedulersAction.Request, Get
@Override
public XContentBuilder toXContent(XContentBuilder builder, Params params) throws IOException {
return schedulers.doXContentBody(builder, params);
builder.startObject();
schedulers.doXContentBody(builder, params);
builder.endObject();
return builder;
}
@Override

View File

@ -213,7 +213,10 @@ public class GetSchedulersStatsAction extends Action<GetSchedulersStatsAction.Re
@Override
public XContentBuilder toXContent(XContentBuilder builder, Params params) throws IOException {
return schedulersStats.doXContentBody(builder, params);
builder.startObject();
schedulersStats.doXContentBody(builder, params);
builder.endObject();
return builder;
}
@Override

View File

@ -104,7 +104,10 @@ public class JobDataAction extends Action<JobDataAction.Request, JobDataAction.R
@Override
public XContentBuilder toXContent(XContentBuilder builder, Params params) throws IOException {
return dataCounts.doXContentBody(builder, params);
builder.startObject();
dataCounts.doXContentBody(builder, params);
builder.endObject();
return builder;
}
@Override

View File

@ -179,7 +179,9 @@ public class PutJobAction extends Action<PutJobAction.Request, PutJobAction.Resp
@Override
public XContentBuilder toXContent(XContentBuilder builder, Params params) throws IOException {
// Don't serialize acknowledged because current api directly serializes the job details
builder.startObject();
job.doXContentBody(builder, params);
builder.endObject();
return builder;
}

View File

@ -198,9 +198,11 @@ PutModelSnapshotDescriptionAction.RequestBuilder> {
@Override
public XContentBuilder toXContent(XContentBuilder builder, Params params) throws IOException {
builder.startObject();
builder.field(ACKNOWLEDGED.getPreferredName(), true);
builder.field(MODEL.getPreferredName());
builder = model.toXContent(builder, params);
builder.endObject();
return builder;
}

View File

@ -155,7 +155,9 @@ public class PutSchedulerAction extends Action<PutSchedulerAction.Request, PutSc
@Override
public XContentBuilder toXContent(XContentBuilder builder, Params params) throws IOException {
builder.startObject();
scheduler.doXContentBody(builder, params);
builder.endObject();
return builder;
}

View File

@ -265,9 +265,11 @@ extends Action<RevertModelSnapshotAction.Request, RevertModelSnapshotAction.Resp
@Override
public XContentBuilder toXContent(XContentBuilder builder, Params params) throws IOException {
builder.startObject();
builder.field(ACKNOWLEDGED.getPreferredName(), true);
builder.field(MODEL.getPreferredName());
builder = model.toXContent(builder, params);
builder.endObject();
return builder;
}

View File

@ -59,6 +59,6 @@ public class RestGetInfluencersAction extends BaseRestHandler {
request.setDecending(restRequest.paramAsBoolean(GetInfluencersAction.Request.DESCENDING_SORT.getPreferredName(), true));
}
return channel -> transportAction.execute(request, new RestToXContentListener<GetInfluencersAction.Response>(channel));
return channel -> transportAction.execute(request, new RestToXContentListener<>(channel));
}
}