@Override
    public List<HasMetadata> buildAccompanyingKubernetesResources() throws IOException {
        final Service service =
                kubernetesJobManagerParameters
                        .getRestServiceExposedType()
                        .serviceType()
                        .buildUpExternalRestService(kubernetesJobManagerParameters);

        return Collections.singletonList(service);
    }
@Test
    void testBuildAccompanyingKubernetesResources() throws IOException {
        final List<HasMetadata> resources =
                this.externalServiceDecorator.buildAccompanyingKubernetesResources();
        assertThat(resources).hasSize(1);

        final Service restService = (Service) resources.get(0);

        assertThat(restService.getApiVersion()).isEqualTo(Constants.API_VERSION);

        assertThat(restService.getMetadata().getName())
                .isEqualTo(ExternalServiceDecorator.getExternalServiceName(CLUSTER_ID));

        final Map<String, String> expectedLabels = getCommonLabels();
        assertThat(restService.getMetadata().getLabels()).isEqualTo(expectedLabels);

        assertThat(restService.getSpec().getType())
                .isEqualTo(KubernetesConfigOptions.ServiceExposedType.ClusterIP.name());

        final List<ServicePort> expectedServicePorts =
                Collections.singletonList(
                        new ServicePortBuilder()
                                .withName(Constants.REST_PORT_NAME)
                                .withPort(REST_PORT)
                                .withNewTargetPort(Integer.valueOf(REST_BIND_PORT))
                                .build());
        assertThat(restService.getSpec().getPorts()).isEqualTo(expectedServicePorts);

        expectedLabels.put(Constants.LABEL_COMPONENT_KEY, Constants.LABEL_COMPONENT_JOB_MANAGER);
        assertThat(restService.getSpec().getSelector()).isEqualTo(expectedLabels);

        final Map<String, String> resultAnnotations = restService.getMetadata().getAnnotations();
        assertThat(resultAnnotations).isEqualTo(customizedAnnotations);
    }