File tree 3 files changed +18
-2
lines changed
client/rest-high-level/src
main/java/org/elasticsearch/client/ilm
test/java/org/elasticsearch/client/ilm
x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ilm
3 files changed +18
-2
lines changed Original file line number Diff line number Diff line change @@ -56,6 +56,10 @@ public String getName() {
56
56
return NAME ;
57
57
}
58
58
59
+ boolean isEnabled () {
60
+ return enabled ;
61
+ }
62
+
59
63
@ Override
60
64
public int hashCode () {
61
65
return Objects .hashCode (enabled );
@@ -69,7 +73,7 @@ public boolean equals(Object obj) {
69
73
if (obj .getClass () != getClass ()) {
70
74
return false ;
71
75
}
72
- return true ;
76
+ return enabled == (( MigrateAction ) obj ). enabled ;
73
77
}
74
78
75
79
@ Override
Original file line number Diff line number Diff line change 9
9
10
10
import org .elasticsearch .common .xcontent .XContentParser ;
11
11
import org .elasticsearch .test .AbstractXContentTestCase ;
12
+ import org .elasticsearch .test .EqualsHashCodeTestUtils ;
12
13
13
14
import java .io .IOException ;
14
15
@@ -32,4 +33,10 @@ static MigrateAction randomInstance() {
32
33
protected boolean supportsUnknownFields () {
33
34
return false ;
34
35
}
36
+
37
+ public void testEqualsHashCode () {
38
+ EqualsHashCodeTestUtils .checkEqualsAndHashCode (createTestInstance (),
39
+ m -> new MigrateAction (m .isEnabled ()),
40
+ m -> new MigrateAction (m .isEnabled () == false ));
41
+ }
35
42
}
Original file line number Diff line number Diff line change @@ -42,7 +42,12 @@ protected MigrateAction doParseInstance(XContentParser parser) throws IOExceptio
42
42
43
43
@ Override
44
44
protected MigrateAction createTestInstance () {
45
- return new MigrateAction ();
45
+ return new MigrateAction (randomBoolean ());
46
+ }
47
+
48
+ @ Override
49
+ protected MigrateAction mutateInstance (MigrateAction instance ) throws IOException {
50
+ return new MigrateAction (instance .isEnabled () == false );
46
51
}
47
52
48
53
@ Override
You can’t perform that action at this time.
0 commit comments