SystemConfig extends MapConfig { public boolean deleteCommittedMessages(String systemName) { return getBoolean(String.format(DELETE_COMMITTED_MESSAGES, systemName), false); } SystemConfig(Config config); Optional<String> getSystemFactory(String systemName); List<String> getSystemNames(); Map<String, SystemAdmin> getSystemAdmins(String adminLabel); Map<String, SystemAdmin> getSystemAdmins(); SystemAdmin getSystemAdmin(String systemName, String adminLabel); SystemAdmin getSystemAdmin(String systemName); Map<String, SystemFactory> getSystemFactories(); Config getDefaultStreamProperties(String systemName); String getSystemOffsetDefault(String systemName); Optional<String> getSystemKeySerde(String systemName); Optional<String> getSystemMsgSerde(String systemName); boolean deleteCommittedMessages(String systemName); static final String SYSTEM_ID_PREFIX; static final String SYSTEM_FACTORY_FORMAT; static final String SYSTEM_DEFAULT_STREAMS_PREFIX_FORMAT; }
@Test public void testDeleteCommittedMessages() { Config config = new MapConfig(ImmutableMap.of( String.format(SystemConfig.DELETE_COMMITTED_MESSAGES, MOCK_SYSTEM_NAME1), "true", String.format(SystemConfig.DELETE_COMMITTED_MESSAGES, MOCK_SYSTEM_NAME2), "false")); SystemConfig systemConfig = new SystemConfig(config); assertTrue(systemConfig.deleteCommittedMessages(MOCK_SYSTEM_NAME1)); assertFalse(systemConfig.deleteCommittedMessages(MOCK_SYSTEM_NAME2)); assertFalse(systemConfig.deleteCommittedMessages("other-system")); }