@Override
    public FlinkPod decorateFlinkPod(FlinkPod flinkPod) {
        if (!getTaskManagerPodTemplateFile().isPresent()) {
            return flinkPod;
        }

        final Pod mountedPod = decoratePod(flinkPod.getPodWithoutMainContainer());

        final Container mountedMainContainer =
                new ContainerBuilder(flinkPod.getMainContainer())
                        .addNewVolumeMount()
                        .withName(POD_TEMPLATE_VOLUME)
                        .withMountPath(POD_TEMPLATE_DIR_IN_POD)
                        .endVolumeMount()
                        .build();

        return new FlinkPod.Builder(flinkPod)
                .withPod(mountedPod)
                .withMainContainer(mountedMainContainer)
                .build();
    }
@Test
    void testDecoratedFlinkPodWithTaskManagerPodTemplate() throws Exception {
        KubernetesTestUtils.createTemporyFile(
                POD_TEMPLATE_DATA, flinkConfDir, POD_TEMPLATE_FILE_NAME);

        final FlinkPod resultFlinkPod = podTemplateMountDecorator.decorateFlinkPod(baseFlinkPod);

        final List<KeyToPath> expectedKeyToPaths =
                Collections.singletonList(
                        new KeyToPathBuilder()
                                .withKey(TASK_MANAGER_POD_TEMPLATE_FILE_NAME)
                                .withPath(TASK_MANAGER_POD_TEMPLATE_FILE_NAME)
                                .build());
        final List<Volume> expectedVolumes = getExpectedVolumes(expectedKeyToPaths);
        assertThat(resultFlinkPod.getPodWithoutMainContainer().getSpec().getVolumes())
                .containsExactlyInAnyOrderElementsOf(expectedVolumes);

        final List<VolumeMount> expectedVolumeMounts =
                Collections.singletonList(
                        new VolumeMountBuilder()
                                .withName(Constants.POD_TEMPLATE_VOLUME)
                                .withMountPath(Constants.POD_TEMPLATE_DIR_IN_POD)
                                .build());
        assertThat(resultFlinkPod.getMainContainer().getVolumeMounts())
                .containsExactlyInAnyOrderElementsOf(expectedVolumeMounts);
    }