@Override
    public void fatal(Throwable t) {
        fatalHandler.accept(t);
    }
@Test
    public void testFatal() {
        Throwable fatalException = new Exception("test-fatal-exception");
        AtomicBoolean fatalInvoked = new AtomicBoolean(false);
        context = new ContextImpl(
                config,
                logger,
                client,
                new EnvironmentBasedSecretsProvider(), FunctionCollectorRegistry.getDefaultImplementation(),
                new String[0],
                FunctionDetails.ComponentType.FUNCTION, null, new InstanceStateManager(),
                pulsarAdmin, clientBuilder, t -> {
                    assertEquals(t, fatalException);
                    fatalInvoked.set(true);
        }, producerCache);
        context.fatal(fatalException);
        assertTrue(fatalInvoked.get());
    }