@Test public void when_first_template_is_empty_but_second_is_not_then_still_return_empty_list(){ String template = "cn=${login}+sn=secret, ou=users, dc=example, dc=com"; helper.setPatterns("", template); assertThat(fetcher.collect()).isEmpty(); }
public List<String> collect(){ index = 0; final List<String> templates = new ArrayList<String>(); for(String nextTemplate = getNextTemplate(); !StringUtil.isEmpty(nextTemplate); index++, nextTemplate = getNextTemplate()){ templates.add(nextTemplate); } return templates; }
DnTemplateCollector { public List<String> collect(){ index = 0; final List<String> templates = new ArrayList<String>(); for(String nextTemplate = getNextTemplate(); !StringUtil.isEmpty(nextTemplate); index++, nextTemplate = getNextTemplate()){ templates.add(nextTemplate); } return templates; } }
DnTemplateCollector { public List<String> collect(){ index = 0; final List<String> templates = new ArrayList<String>(); for(String nextTemplate = getNextTemplate(); !StringUtil.isEmpty(nextTemplate); index++, nextTemplate = getNextTemplate()){ templates.add(nextTemplate); } return templates; } DnTemplateCollector(); }
DnTemplateCollector { public List<String> collect(){ index = 0; final List<String> templates = new ArrayList<String>(); for(String nextTemplate = getNextTemplate(); !StringUtil.isEmpty(nextTemplate); index++, nextTemplate = getNextTemplate()){ templates.add(nextTemplate); } return templates; } DnTemplateCollector(); List<String> collect(); }
DnTemplateCollector { public List<String> collect(){ index = 0; final List<String> templates = new ArrayList<String>(); for(String nextTemplate = getNextTemplate(); !StringUtil.isEmpty(nextTemplate); index++, nextTemplate = getNextTemplate()){ templates.add(nextTemplate); } return templates; } DnTemplateCollector(); List<String> collect();  }