KieServerConnectionInfoProviderImpl implements KieServerConnectionInfoProvider { @Override public List<String> serverTemplates() { return Optional.ofNullable(System.getProperty(SERVER_TEMPLATE_LIST_PROPERTY)) .map(templates -> templates.split(SERVER_TEMPLATE_SEPARATOR)) .map(template -> Arrays.stream(template) .map(String::trim) .filter(s -> !s.isEmpty()) .collect(Collectors.toList())) .orElse(Collections.emptyList()); }  @Override List<String> serverTemplates(); @Override KieServerConnectionInfo verifiedConnectionInfo(RemoteDataSetDef def); @Override Optional<KieServerConnectionInfo> get(String name,
                                                 String serverTemplate); Optional<String> serverTemplateProperty(String serverTemplate,
                                                   KieServerConfigurationKey configurationKey); Optional<String> remoteDatasetProperty(String datasetUUID,
                                                  KieServerConfigurationKey configurationKey);  }
@Test public void serverListTest() { System.setProperty(KieServerConnectionInfoProviderImpl.SERVER_TEMPLATE_LIST_PROPERTY, "server1, server2, server3"); List<String> serverTemplates = kieServerConnectionInfoProvider.serverTemplates(); assertEquals(3, serverTemplates.size()); List<String> expectedList = Arrays.asList("server1", "server2", "server3"); assertEquals(expectedList, serverTemplates); }
@Test public void emptyServerListTest() { System.setProperty(KieServerConnectionInfoProviderImpl.SERVER_TEMPLATE_LIST_PROPERTY, ""); List<String> serverTemplates = kieServerConnectionInfoProvider.serverTemplates(); assertTrue(serverTemplates.isEmpty()); }