@Override
    public void createDataStream(String dataStreamName, String timestampField, Map<String, Map<String, String>> mappings,
                                 Policy ismPolicy) {
        updateDataStreamTemplate(dataStreamName, timestampField, mappings);
        dataStreamAdapter.createDataStream(dataStreamName);
        dataStreamAdapter.applyIsmPolicy(dataStreamName, ismPolicy);
        dataStreamAdapter.setNumberOfReplicas(dataStreamName, replicas);
    }
@SuppressWarnings("unchecked")
    @Test
    public void templateCreatesTimestampMapping() {
        final Map<String, Map<String, String>> mappings = new HashMap<>();
        String ts = "ts";
        dataStreamService.createDataStream("teststream", ts, mappings, mock(Policy.class));
        ArgumentCaptor<Template> templateCaptor = ArgumentCaptor.forClass(Template.class);
        verify(dataStreamAdapter).ensureDataStreamTemplate(anyString(), templateCaptor.capture(), anyString());
        Map<String, Object> fieldMappings = (Map<String, Object>) templateCaptor.getValue().mappings().get("properties");
        Map<String, String> timestampMapping = (Map<String, String>) fieldMappings.get(ts);
        assertThat(timestampMapping).isNotNull();
        assertThat(timestampMapping.get("type")).isEqualTo("date");
        assertThat(timestampMapping.get("format")).isEqualTo("yyyy-MM-dd HH:mm:ss.SSS||strict_date_optional_time||epoch_millis");
    }