Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
Signed-off-by: Nicholas Walter Knize <nknize@apache.org>
  • Loading branch information
nknize committed Aug 8, 2023
1 parent 9e2dc47 commit 8262a1d
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 49 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@
import org.opensearch.core.common.bytes.BytesReference;
import org.opensearch.core.xcontent.MediaType;
import org.opensearch.core.xcontent.XContentBuilder;
import org.opensearch.common.xcontent.XContentType;
import org.opensearch.index.VersionType;

import java.util.Map;
Expand Down Expand Up @@ -83,8 +82,8 @@ public IndexRequestBuilder setRouting(String routing) {
/**
* Sets the source.
*/
public IndexRequestBuilder setSource(BytesReference source, XContentType xContentType) {
request.source(source, xContentType);
public IndexRequestBuilder setSource(BytesReference source, MediaType mediaType) {
request.source(source, mediaType);
return this;
}

Expand Down Expand Up @@ -142,10 +141,10 @@ public IndexRequestBuilder setSource(byte[] source, MediaType mediaType) {
* @param source The source to index
* @param offset The offset in the byte array
* @param length The length of the data
* @param xContentType The type/format of the source
* @param mediaType The type/format of the source
*/
public IndexRequestBuilder setSource(byte[] source, int offset, int length, XContentType xContentType) {
request.source(source, offset, length, xContentType);
public IndexRequestBuilder setSource(byte[] source, int offset, int length, MediaType mediaType) {
request.source(source, offset, length, mediaType);
return this;
}

Expand All @@ -170,8 +169,8 @@ public IndexRequestBuilder setSource(Object... source) {
* valid String representation.</b>
* </p>
*/
public IndexRequestBuilder setSource(XContentType xContentType, Object... source) {
request.source(xContentType, source);
public IndexRequestBuilder setSource(MediaType mediaType, Object... source) {
request.source(mediaType, source);
return this;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@
import org.opensearch.core.xcontent.XContentBuilder;
import org.opensearch.common.xcontent.XContentHelper;
import org.opensearch.core.xcontent.XContentParser;
import org.opensearch.common.xcontent.XContentType;
import org.opensearch.index.VersionType;
import org.opensearch.index.mapper.MapperService;
import org.opensearch.core.index.shard.ShardId;
Expand Down Expand Up @@ -663,32 +662,32 @@ public UpdateRequest doc(Map<String, Object> source) {
/**
* Sets the doc to use for updates when a script is not specified.
*/
public UpdateRequest doc(Map<String, Object> source, XContentType contentType) {
safeDoc().source(source, contentType);
public UpdateRequest doc(Map<String, Object> source, MediaType mediaType) {
safeDoc().source(source, mediaType);
return this;
}

/**
* Sets the doc to use for updates when a script is not specified.
*/
public UpdateRequest doc(String source, XContentType xContentType) {
safeDoc().source(source, xContentType);
public UpdateRequest doc(String source, MediaType mediaType) {
safeDoc().source(source, mediaType);
return this;
}

/**
* Sets the doc to use for updates when a script is not specified.
*/
public UpdateRequest doc(byte[] source, XContentType xContentType) {
safeDoc().source(source, xContentType);
public UpdateRequest doc(byte[] source, MediaType mediaType) {
safeDoc().source(source, mediaType);
return this;
}

/**
* Sets the doc to use for updates when a script is not specified.
*/
public UpdateRequest doc(byte[] source, int offset, int length, XContentType xContentType) {
safeDoc().source(source, offset, length, xContentType);
public UpdateRequest doc(byte[] source, int offset, int length, MediaType mediaType) {
safeDoc().source(source, offset, length, mediaType);
return this;
}

Expand All @@ -705,8 +704,8 @@ public UpdateRequest doc(Object... source) {
* Sets the doc to use for updates when a script is not specified, the doc provided
* is a field and value pairs.
*/
public UpdateRequest doc(MediaType xContentType, Object... source) {
safeDoc().source(xContentType, source);
public UpdateRequest doc(MediaType mediaType, Object... source) {
safeDoc().source(mediaType, source);
return this;
}

Expand Down Expand Up @@ -749,32 +748,32 @@ public UpdateRequest upsert(Map<String, Object> source) {
/**
* Sets the doc source of the update request to be used when the document does not exists.
*/
public UpdateRequest upsert(Map<String, Object> source, XContentType contentType) {
safeUpsertRequest().source(source, contentType);
public UpdateRequest upsert(Map<String, Object> source, MediaType mediaType) {
safeUpsertRequest().source(source, mediaType);
return this;
}

/**
* Sets the doc source of the update request to be used when the document does not exists.
*/
public UpdateRequest upsert(String source, XContentType xContentType) {
safeUpsertRequest().source(source, xContentType);
public UpdateRequest upsert(String source, MediaType mediaType) {
safeUpsertRequest().source(source, mediaType);
return this;
}

/**
* Sets the doc source of the update request to be used when the document does not exists.
*/
public UpdateRequest upsert(byte[] source, XContentType xContentType) {
safeUpsertRequest().source(source, xContentType);
public UpdateRequest upsert(byte[] source, MediaType mediaType) {
safeUpsertRequest().source(source, mediaType);
return this;
}

/**
* Sets the doc source of the update request to be used when the document does not exists.
*/
public UpdateRequest upsert(byte[] source, int offset, int length, XContentType xContentType) {
safeUpsertRequest().source(source, offset, length, xContentType);
public UpdateRequest upsert(byte[] source, int offset, int length, MediaType mediaType) {
safeUpsertRequest().source(source, offset, length, mediaType);
return this;
}

Expand All @@ -791,8 +790,8 @@ public UpdateRequest upsert(Object... source) {
* Sets the doc source of the update request to be used when the document does not exists. The doc
* includes field and value pairs.
*/
public UpdateRequest upsert(XContentType xContentType, Object... source) {
safeUpsertRequest().source(xContentType, source);
public UpdateRequest upsert(MediaType mediaType, Object... source) {
safeUpsertRequest().source(mediaType, source);
return this;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@
import org.opensearch.action.support.single.instance.InstanceShardOperationRequestBuilder;
import org.opensearch.client.OpenSearchClient;
import org.opensearch.common.Nullable;
import org.opensearch.core.xcontent.MediaType;
import org.opensearch.core.xcontent.XContentBuilder;
import org.opensearch.common.xcontent.XContentType;
import org.opensearch.index.VersionType;
import org.opensearch.script.Script;

Expand Down Expand Up @@ -230,32 +230,32 @@ public UpdateRequestBuilder setDoc(Map<String, Object> source) {
/**
* Sets the doc to use for updates when a script is not specified.
*/
public UpdateRequestBuilder setDoc(Map<String, Object> source, XContentType contentType) {
public UpdateRequestBuilder setDoc(Map<String, Object> source, MediaType contentType) {
request.doc(source, contentType);
return this;
}

/**
* Sets the doc to use for updates when a script is not specified.
*/
public UpdateRequestBuilder setDoc(String source, XContentType xContentType) {
request.doc(source, xContentType);
public UpdateRequestBuilder setDoc(String source, MediaType mediaType) {
request.doc(source, mediaType);
return this;
}

/**
* Sets the doc to use for updates when a script is not specified.
*/
public UpdateRequestBuilder setDoc(byte[] source, XContentType xContentType) {
request.doc(source, xContentType);
public UpdateRequestBuilder setDoc(byte[] source, MediaType mediaType) {
request.doc(source, mediaType);
return this;
}

/**
* Sets the doc to use for updates when a script is not specified.
*/
public UpdateRequestBuilder setDoc(byte[] source, int offset, int length, XContentType xContentType) {
request.doc(source, offset, length, xContentType);
public UpdateRequestBuilder setDoc(byte[] source, int offset, int length, MediaType mediaType) {
request.doc(source, offset, length, mediaType);
return this;
}

Expand All @@ -272,8 +272,8 @@ public UpdateRequestBuilder setDoc(Object... source) {
* Sets the doc to use for updates when a script is not specified, the doc provided
* is a field and value pairs.
*/
public UpdateRequestBuilder setDoc(XContentType xContentType, Object... source) {
request.doc(xContentType, source);
public UpdateRequestBuilder setDoc(MediaType mediaType, Object... source) {
request.doc(mediaType, source);
return this;
}

Expand Down Expand Up @@ -305,32 +305,32 @@ public UpdateRequestBuilder setUpsert(Map<String, Object> source) {
/**
* Sets the doc source of the update request to be used when the document does not exists.
*/
public UpdateRequestBuilder setUpsert(Map<String, Object> source, XContentType contentType) {
request.upsert(source, contentType);
public UpdateRequestBuilder setUpsert(Map<String, Object> source, MediaType mediaType) {
request.upsert(source, mediaType);
return this;
}

/**
* Sets the doc source of the update request to be used when the document does not exists.
*/
public UpdateRequestBuilder setUpsert(String source, XContentType xContentType) {
request.upsert(source, xContentType);
public UpdateRequestBuilder setUpsert(String source, MediaType mediaType) {
request.upsert(source, mediaType);
return this;
}

/**
* Sets the doc source of the update request to be used when the document does not exists.
*/
public UpdateRequestBuilder setUpsert(byte[] source, XContentType xContentType) {
request.upsert(source, xContentType);
public UpdateRequestBuilder setUpsert(byte[] source, MediaType mediaType) {
request.upsert(source, mediaType);
return this;
}

/**
* Sets the doc source of the update request to be used when the document does not exists.
*/
public UpdateRequestBuilder setUpsert(byte[] source, int offset, int length, XContentType xContentType) {
request.upsert(source, offset, length, xContentType);
public UpdateRequestBuilder setUpsert(byte[] source, int offset, int length, MediaType mediaType) {
request.upsert(source, offset, length, mediaType);
return this;
}

Expand All @@ -347,8 +347,8 @@ public UpdateRequestBuilder setUpsert(Object... source) {
* Sets the doc source of the update request to be used when the document does not exists. The doc
* includes field and value pairs.
*/
public UpdateRequestBuilder setUpsert(XContentType xContentType, Object... source) {
request.upsert(xContentType, source);
public UpdateRequestBuilder setUpsert(MediaType mediaType, Object... source) {
request.upsert(mediaType, source);
return this;
}

Expand Down

0 comments on commit 8262a1d

Please sign in to comment.