SystemConfig extends MapConfig { public Map<String, SystemAdmin> getSystemAdmins(String adminLabel) { if (systemAdminMap.isEmpty()) { systemAdminMap = getSystemFactories().entrySet() .stream() .collect(Collectors.toMap(Entry::getKey, systemNameToFactoryEntry -> systemNameToFactoryEntry.getValue() .getAdmin(systemNameToFactoryEntry.getKey(), this, adminLabel))); } return systemAdminMap; } 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 testGetSystemAdmins() { Map<String, String> map = ImmutableMap.of(MOCK_SYSTEM_FACTORY_NAME1, MockSystemFactory.class.getName()); SystemConfig systemConfig = new SystemConfig(new MapConfig(map)); Map<String, SystemAdmin> expected = ImmutableMap.of(MOCK_SYSTEM_NAME1, SYSTEM_ADMIN1); assertEquals(expected, systemConfig.getSystemAdmins()); }