@Override
    public void configureAuthDataStatefulSet(V1StatefulSet statefulSet, Optional<FunctionAuthData> functionAuthData) {
        V1PodSpec podSpec = statefulSet.getSpec().getTemplate().getSpec();
        // configure pod mount secret with auth token
        if (StringUtil.isNotBlank(brokerTrustCertsSecretName)) {
            podSpec.addVolumesItem(createTrustCertVolume());
        }
        podSpec.addVolumesItem(createServiceAccountVolume());
        podSpec.getContainers().forEach(this::addVolumeMountsToContainer);
    }
@Test
    public void testConfigureAuthDataStatefulSet() {
        HashMap<String, Object> config = new HashMap<>();
        config.put("brokerClientTrustCertsSecretName", "my-secret");
        config.put("serviceAccountTokenExpirationSeconds", "600");
        config.put("serviceAccountTokenAudience", "my-audience");
        KubernetesServiceAccountTokenAuthProvider provider = new KubernetesServiceAccountTokenAuthProvider();
        provider.initialize(null, null, (fd) -> "default", config);

        // Create a stateful set with a container
        V1StatefulSet statefulSet = new V1StatefulSet();
        statefulSet.setSpec(
                new V1StatefulSetSpec().template(
                        new V1PodTemplateSpec().spec(
                                new V1PodSpec().containers(
                                        Collections.singletonList(new V1Container())))));
        provider.configureAuthDataStatefulSet(statefulSet, Optional.empty());

        List<V1Volume> volumes = statefulSet.getSpec().getTemplate().getSpec().getVolumes();
        Assert.assertEquals(volumes.size(), 2);

        Assert.assertEquals(volumes.get(0).getName(), "ca-cert");
        Assert.assertEquals(volumes.get(0).getSecret().getSecretName(), "my-secret");
        Assert.assertEquals(volumes.get(0).getSecret().getItems().size(), 1);
        Assert.assertEquals(volumes.get(0).getSecret().getItems().get(0).getKey(), "ca.crt");
        Assert.assertEquals(volumes.get(0).getSecret().getItems().get(0).getPath(), "ca.crt");


        Assert.assertEquals(volumes.get(1).getName(), "service-account-token");
        Assert.assertEquals(volumes.get(1).getProjected().getSources().size(), 1);
        V1ServiceAccountTokenProjection tokenProjection =
                volumes.get(1).getProjected().getSources().get(0).getServiceAccountToken();
        Assert.assertEquals(tokenProjection.getExpirationSeconds(), 600);
        Assert.assertEquals(tokenProjection.getAudience(), "my-audience");

        Assert.assertEquals(statefulSet.getSpec().getTemplate().getSpec().getContainers().size(), 1);
        Assert.assertEquals(statefulSet.getSpec().getTemplate().getSpec().getContainers().get(0).getVolumeMounts().size(), 2);
        Assert.assertEquals(statefulSet.getSpec().getTemplate().getSpec().getContainers().get(0).getVolumeMounts().get(0).getName(), "service-account-token");
        Assert.assertEquals(statefulSet.getSpec().getTemplate().getSpec().getContainers().get(0).getVolumeMounts().get(0).getMountPath(), "/etc/auth");
        Assert.assertEquals(statefulSet.getSpec().getTemplate().getSpec().getContainers().get(0).getVolumeMounts().get(1).getName(), "ca-cert");
        Assert.assertEquals(statefulSet.getSpec().getTemplate().getSpec().getContainers().get(0).getVolumeMounts().get(1).getMountPath(), "/etc/auth");
    }