IndexService { String indexName(String name, LocalDate now) { return name + "-" + now.format(indexDateFormatter); }  void createIndexTemplatesUntilSuccess(); void createIndexTemplates(); Optional<LocalDate> createdDate(String index);  }
@Test void indexName() { assertThat(indexService.indexName("action", LocalDate.of(2016, Month.JANUARY, 15))).isEqualTo("action-2016.01.15"); assertThat(indexService.indexName("trace", LocalDate.of(2018, Month.AUGUST, 1))).isEqualTo("trace-2018.08.01"); }