Esempio n. 1
0
        public void WindowedChangelogTopicGetPropertiesWithDefault()
        {
            WindowedChangelogTopicConfig c = new WindowedChangelogTopicConfig()
            {
                Name             = "topic1",
                NumberPartitions = 1,
                Configs          = new Dictionary <string, string>()
                {
                    { "config1", "100" }
                },
                RetentionMs = 50
            };

            var configs = c.GetProperties(new Dictionary <string, string>()
            {
                { "default1", "test" }
            }, 120);

            Assert.AreEqual(5, configs.Count);
            Assert.AreEqual("test", configs["default1"]);
            Assert.AreEqual("170", configs[InternalTopicConfigCst.RETENTION_MS_CONFIG]);
            Assert.AreEqual("100", configs["config1"]);
            Assert.AreEqual("CreateTime", configs[InternalTopicConfigCst.MESSAGE_TIMESTAMP_TYPE_CONFIG]);
            Assert.AreEqual("compact,delete", configs[InternalTopicConfigCst.CLEANUP_POLICY_CONFIG]);
        }
Esempio n. 2
0
        public void WindowedChangelogTopicGetPropertiesTooBigLonger()
        {
            WindowedChangelogTopicConfig c = new WindowedChangelogTopicConfig()
            {
                Name             = "topic1",
                NumberPartitions = 1,
                Configs          = new Dictionary <string, string>(),
                RetentionMs      = long.MaxValue - 3
            };

            var configs = c.GetProperties(new Dictionary <string, string>(), 5);

            Assert.AreEqual(3, configs.Count);
            Assert.AreEqual(long.MaxValue.ToString(), configs[InternalTopicConfigCst.RETENTION_MS_CONFIG]);
            Assert.AreEqual("CreateTime", configs[InternalTopicConfigCst.MESSAGE_TIMESTAMP_TYPE_CONFIG]);
            Assert.AreEqual("compact,delete", configs[InternalTopicConfigCst.CLEANUP_POLICY_CONFIG]);
        }