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 @Override
public XContentBuilder toXContent(XContentBuilder builder, Params params) throws IOException { 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 @Override

View File

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

View File

@ -270,7 +270,10 @@ extends Action<GetInfluencersAction.Request, GetInfluencersAction.Response, GetI
@Override @Override
public XContentBuilder toXContent(XContentBuilder builder, Params params) throws IOException { 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 @Override

View File

@ -140,7 +140,10 @@ public class GetJobsAction extends Action<GetJobsAction.Request, GetJobsAction.R
@Override @Override
public XContentBuilder toXContent(XContentBuilder builder, Params params) throws IOException { 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 @Override

View File

@ -242,7 +242,10 @@ public class GetJobsStatsAction extends Action<GetJobsStatsAction.Request, GetJo
@Override @Override
public XContentBuilder toXContent(XContentBuilder builder, Params params) throws IOException { 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 @Override

View File

@ -188,7 +188,10 @@ public class GetListAction extends Action<GetListAction.Request, GetListAction.R
@Override @Override
public XContentBuilder toXContent(XContentBuilder builder, Params params) throws IOException { 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 @Override

View File

@ -260,7 +260,10 @@ extends Action<GetModelSnapshotsAction.Request, GetModelSnapshotsAction.Response
@Override @Override
public XContentBuilder toXContent(XContentBuilder builder, Params params) throws IOException { 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 @Override

View File

@ -305,7 +305,10 @@ public class GetRecordsAction extends Action<GetRecordsAction.Request, GetRecord
@Override @Override
public XContentBuilder toXContent(XContentBuilder builder, Params params) throws IOException { 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 @Override

View File

@ -152,7 +152,10 @@ public class GetSchedulersAction extends Action<GetSchedulersAction.Request, Get
@Override @Override
public XContentBuilder toXContent(XContentBuilder builder, Params params) throws IOException { 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 @Override

View File

@ -213,7 +213,10 @@ public class GetSchedulersStatsAction extends Action<GetSchedulersStatsAction.Re
@Override @Override
public XContentBuilder toXContent(XContentBuilder builder, Params params) throws IOException { 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 @Override

View File

@ -104,7 +104,10 @@ public class JobDataAction extends Action<JobDataAction.Request, JobDataAction.R
@Override @Override
public XContentBuilder toXContent(XContentBuilder builder, Params params) throws IOException { 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 @Override

View File

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

View File

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

View File

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

View File

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

View File

@ -59,6 +59,6 @@ public class RestGetInfluencersAction extends BaseRestHandler {
request.setDecending(restRequest.paramAsBoolean(GetInfluencersAction.Request.DESCENDING_SORT.getPreferredName(), true)); 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));
} }
} }