Add wire tests to delete autoscaling policy request

This commit adds some wire serializing tests for delete autoscaling
policy requests.
This commit is contained in:
Jason Tedor 2020-04-05 21:17:27 -04:00
parent 98c4165348
commit 8f520f0a9c
No known key found for this signature in database
GPG Key ID: 8CF9C19984731E85
2 changed files with 38 additions and 0 deletions

View File

@ -53,6 +53,19 @@ public class DeleteAutoscalingPolicyAction extends ActionType<AcknowledgedRespon
return null; return null;
} }
@Override
public boolean equals(final Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
final Request request = (Request) o;
return name.equals(request.name);
}
@Override
public int hashCode() {
return Objects.hash(name);
}
} }
} }

View File

@ -0,0 +1,25 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License;
* you may not use this file except in compliance with the Elastic License.
*/
package org.elasticsearch.xpack.autoscaling.action;
import org.elasticsearch.common.io.stream.Writeable;
import org.elasticsearch.test.AbstractWireSerializingTestCase;
public class DeleteAutoscalingPolicyActionRequestWireSerializingTests extends AbstractWireSerializingTestCase<
DeleteAutoscalingPolicyAction.Request> {
@Override
protected Writeable.Reader<DeleteAutoscalingPolicyAction.Request> instanceReader() {
return DeleteAutoscalingPolicyAction.Request::new;
}
@Override
protected DeleteAutoscalingPolicyAction.Request createTestInstance() {
return new DeleteAutoscalingPolicyAction.Request(randomAlphaOfLength(8));
}
}