@Override
    public PulsarAdmin getPulsarAdmin() {
        if (exposePulsarAdminClientEnabled) {
            return pulsarAdmin;
        } else {
            throw new IllegalStateException("PulsarAdmin is not enabled in function worker");
        }
    }
@Test(expectedExceptions = IllegalStateException.class)
    public void testGetPulsarAdminWithExposePulsarAdminDisabled() throws PulsarClientException {
        config.setExposePulsarAdminClientEnabled(false);
        context = new ContextImpl(
                config,
                logger,
                client,
                new EnvironmentBasedSecretsProvider(), FunctionCollectorRegistry.getDefaultImplementation(),
                new String[0],
                FunctionDetails.ComponentType.FUNCTION, null, new InstanceStateManager(),
                pulsarAdmin, clientBuilder, t -> {}, producerCache);
        context.getPulsarAdmin();
    }