@Test public void when_the_are_multiple_templates_then_return_them_in_the_same_order(){ String template0 = "cn=${login}+sn=secret, ou=users, dc=example, dc=com"; String template1 = "cn=${login}+sn=secret, ou=customers, dc=example, dc=com"; String template2 = "cn=${login}+sn=secret, ou=users, dc=test, dc=com"; helper.setPatterns(template0, template1, template2); assertThat(fetcher.collect()).containsSequence(template0, template1, template2); }
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();  }