Skip to content

Commit

Permalink
fixed change policy test Signed-off-by: Ronnak Saxena <ronsax@amazon.…
Browse files Browse the repository at this point in the history
…com>
  • Loading branch information
ronnaksaxena committed Jul 27, 2022
1 parent 4ea3056 commit 3323a84
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ data class ChangePolicy(
val include: List<StateFilter>,
val isSafe: Boolean,
val user: User? = null,
var continuous: Boolean? = null
val continuous: Boolean? = null

) : Writeable, ToXContentObject {

Expand Down Expand Up @@ -72,7 +72,8 @@ data class ChangePolicy(
out.writeBoolean(isSafe)
out.writeBoolean(user != null)
user?.writeTo(out)
if (continuous != null) { out.writeBoolean(continuous as Boolean) }
out.writeBoolean(continuous != null)
if (continuous != null) out.writeBoolean(continuous)
}

companion object {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class ChangePolicyRequest(
val indices: List<String>,
val changePolicy: ChangePolicy,
val indexType: String,
val continuous: Boolean
val continuous: Boolean = false
) : ActionRequest() {

@Throws(IOException::class)
Expand Down Expand Up @@ -47,7 +47,7 @@ class ChangePolicyRequest(
out.writeStringCollection(indices)
changePolicy.writeTo(out)
out.writeString(indexType)
out.writeBoolean(continuous)
out.writeBoolean(if (continuous != null) continuous else false)
}

companion object {
Expand Down

0 comments on commit 3323a84

Please sign in to comment.