Skip to content

Commit 4dbcc08

Browse files
authored
Add test with null transform id in stats request (#74130)
1 parent a5d2251 commit 4dbcc08

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/transform/action/GetTransformStatsAction.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ public Request(String id) {
5858
} else {
5959
this.id = id;
6060
}
61-
this.expandedIds = Collections.singletonList(id);
61+
this.expandedIds = Collections.singletonList(this.id);
6262
}
6363

6464
public Request(StreamInput in) throws IOException {

x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/transform/action/GetTransformStatsActionRequestTests.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,11 @@
1515
public class GetTransformStatsActionRequestTests extends AbstractWireSerializingTestCase<Request> {
1616
@Override
1717
protected Request createTestInstance() {
18-
if (randomBoolean()) {
19-
return new Request(Metadata.ALL);
20-
}
21-
return new Request(randomAlphaOfLengthBetween(1, 20));
18+
return new Request(
19+
randomBoolean()
20+
? randomAlphaOfLengthBetween(1, 20)
21+
: randomBoolean() ? Metadata.ALL : null
22+
);
2223
}
2324

2425
@Override

0 commit comments

Comments
 (0)