This is an automated email from the ASF dual-hosted git repository.
coderzc pushed a commit to branch branch-4.0
in repository https://gitbox.apache.org/repos/asf/pulsar.git
The following commit(s) were added to refs/heads/branch-4.0 by this push:
new f7fd2bbbe0c [fix][test] Fix compile error in OffloadPoliciesTest
f7fd2bbbe0c is described below
commit f7fd2bbbe0c6c9c388c0e6eefc2947f5fc9cc17f
Author: coderzc <[email protected]>
AuthorDate: Mon May 18 23:59:00 2026 +0800
[fix][test] Fix compile error in OffloadPoliciesTest
Replace invalid Collections.singletonMap with multi-arg form and
Java 9+ Map.of() with Java 8 compatible alternatives.
---
.../pulsar/common/policies/data/OffloadPoliciesTest.java | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
diff --git
a/pulsar-common/src/test/java/org/apache/pulsar/common/policies/data/OffloadPoliciesTest.java
b/pulsar-common/src/test/java/org/apache/pulsar/common/policies/data/OffloadPoliciesTest.java
index 61aeb373a82..62934343e59 100644
---
a/pulsar-common/src/test/java/org/apache/pulsar/common/policies/data/OffloadPoliciesTest.java
+++
b/pulsar-common/src/test/java/org/apache/pulsar/common/policies/data/OffloadPoliciesTest.java
@@ -364,10 +364,11 @@ public class OffloadPoliciesTest {
OffloadPoliciesImpl.mergeConfiguration(topicLevelPolicies,
null, brokerProperties);
Assert.assertNotNull(offloadPolicies);
- assertEquals(offloadPolicies.getManagedLedgerExtraConfigurations(),
- Collections.singletonMap("tieredStorageBucketPrefix",
"topic-prefix",
- "brokerOnly", "broker-value",
- "topicOnly", "topic-value"));
+ Map<String, String> expectedConfigs = new HashMap<>();
+ expectedConfigs.put("tieredStorageBucketPrefix", "topic-prefix");
+ expectedConfigs.put("brokerOnly", "broker-value");
+ expectedConfigs.put("topicOnly", "topic-value");
+ assertEquals(offloadPolicies.getManagedLedgerExtraConfigurations(),
expectedConfigs);
}
@Test
@@ -383,7 +384,7 @@ public class OffloadPoliciesTest {
Assert.assertNotNull(offloadPolicies);
assertEquals(offloadPolicies.getManagedLedgerExtraConfigurations(),
- Map.of("tieredStorageBucketPrefix", "broker-prefix"));
+ Collections.singletonMap("tieredStorageBucketPrefix",
"broker-prefix"));
}
@Test