Repository: apache/flink
File: flink-kubernetes/src/test/java/org/apache/flink/kubernetes/kubeclient/parameters/KubernetesJobManagerParametersTest.java (Java)

Code before:

        assertThat(resultAnnotations).isEqualTo(expectedAnnotations);
    }

    @Test
    void testGetRestServiceAnnotations() {
        final Map<String, String> expectedAnnotations = new HashMap<>();
        expectedAnnotations.put("a1", "v1");
        expectedAnnotations.put("a2", "v2");

        flinkConfig.set(KubernetesConfigOptions.REST_SERVICE_ANNOTATIONS, expectedAnnotations);

        final Map<String, String> resultAnnotations =
                kubernetesJobManagerParameters.getRestServiceAnnotations();

        assertThat(resultAnnotations).isEqualTo(expectedAnnotations);
    }

    @Test
    void testGetRestServiceLabels() {
        final Map<String, String> expectedLabels = new HashMap<>();
        expectedLabels.put("a1", "v1");
        expectedLabels.put("a2", "v2");

        flinkConfig.set(KubernetesConfigOptions.REST_SERVICE_LABELS, expectedLabels);

        final Map<String, String> resultLabels =
                kubernetesJobManagerParameters.getRestServiceLabels();

        assertThat(resultLabels).isEqualTo(expectedLabels);
    }

    @Test
    void testGetInternalServiceAnnotations() {
        final Map<String, String> expectedAnnotations = new HashMap<>();
        expectedAnnotations.put("a1", "v1");
        expectedAnnotations.put("a2", "v2");

        flinkConfig.set(KubernetesConfigOptions.INTERNAL_SERVICE_ANNOTATIONS, expectedAnnotations);

        final Map<String, String> resultAnnotations =
                kubernetesJobManagerParameters.getInternalServiceAnnotations();

        assertThat(resultAnnotations).isEqualTo(expectedAnnotations);
    }

    @Test
    void testGetInternalServiceLabels() {
        final Map<String, String> expectedLabels = new HashMap<>();
        expectedLabels.put("a1", "v1");
        expectedLabels.put("a2", "v2");

Review comment (suggestion):
Both asserts can be improved in this test like:
```java
assertThat(resultLabels)
        .containsExactlyInAnyOrderEntriesOf(Map.of("a1", "v1", "a2", "v2"));
```

Code after:

        assertThat(resultAnnotations).isEqualTo(expectedAnnotations);
    }

    @Test
    void testGetRestServiceAnnotations() {
        final Map<String, String> expectedAnnotations = Map.of("a1", "v1", "a2", "v2");

        flinkConfig.set(KubernetesConfigOptions.REST_SERVICE_ANNOTATIONS, expectedAnnotations);

        final Map<String, String> resultAnnotations =
                kubernetesJobManagerParameters.getRestServiceAnnotations();

        assertThat(resultAnnotations).isEqualTo(expectedAnnotations);
    }

    @Test
    void testGetRestServiceLabels() {
        final Map<String, String> expectedLabels = Map.of("a1", "v1", "a2", "v2");

        flinkConfig.set(KubernetesConfigOptions.REST_SERVICE_LABELS, expectedLabels);

        final Map<String, String> resultLabels =
                kubernetesJobManagerParameters.getRestServiceLabels();

        assertThat(resultLabels).isEqualTo(expectedLabels);
    }

    @Test
    void testGetInternalServiceAnnotations() {
        final Map<String, String> expectedAnnotations = new HashMap<>();
        expectedAnnotations.put("a1", "v1");
        expectedAnnotations.put("a2", "v2");

        flinkConfig.set(KubernetesConfigOptions.INTERNAL_SERVICE_ANNOTATIONS, expectedAnnotations);

        final Map<String, String> resultAnnotations =
                kubernetesJobManagerParameters.getInternalServiceAnnotations();

        assertThat(resultAnnotations).isEqualTo(expectedAnnotations);
    }

    @Test
    void testGetInternalServiceLabels() {
        final Map<String, String> expectedLabels = new HashMap<>();
        expectedLabels.put("a1", "v1");
        expectedLabels.put("a2", "v2");

        flinkConfig.set(KubernetesConfigOptions.INTERNAL_SERVICE_LABELS, expectedLabels);

        final Map<String, String> resultLabels =