@Test
public void testListTemplates() throws Exception {

    final ImmutableList<PoolTemplate> templates = ImmutableList.<PoolTemplate>of(
        XmlTemplate.newXmlTemplate(readDefaultTemplate("jenkins")),
        XmlTemplate.newXmlTemplate(readDefaultTemplate("cdh3")));
    ListTemplatesCommand command = new ListTemplatesCommand(templates);
    command.setOut(out);
    command.execute(mock(CommandSession.class));
    out.flush();
    assertThat(outputStream.toString()).contains("jenkins").contains("cdh3");
}