public Template getIndexTemplate(IndexSet indexSet) {
        final IndexSetMappingTemplate indexSetMappingTemplate = getTemplateIndexSetConfig(indexSet, indexSet.getConfig(), profileService);
        return indexMappingFactory.createIndexMapping(indexSet.getConfig())
                .toTemplate(indexSetMappingTemplate);
    }
@Test
    void testUsesCustomMappingsWhileGettingTemplateWhenProfileIsNull() {
        final CustomFieldMappings individualCustomFieldMappings = new CustomFieldMappings(List.of(
                new CustomFieldMapping("f1", "string"),
                new CustomFieldMapping("f2", "long")
        ));
        final TestIndexSet testIndexSet = indexSetConfig("test",
                "test-template-profiles",
                "custom",
                "000000000000000000000013",
                individualCustomFieldMappings);
        doReturn(Optional.of(new IndexFieldTypeProfile(
                "000000000000000000000013",
                "empty_test_profile",
                "Empty test profile",
                new CustomFieldMappings(List.of()))
        )).when(profileService).get("000000000000000000000013");
        IndexMappingTemplate indexMappingTemplateMock = mock(IndexMappingTemplate.class);
        doReturn(indexMappingTemplateMock).when(indexMappingFactory).createIndexMapping(testIndexSet.getConfig());
        underTest.getIndexTemplate(testIndexSet);

        verify(indexMappingTemplateMock).toTemplate(
                new IndexSetMappingTemplate("standard", "test_*",
                        individualCustomFieldMappings)
        );
    }