package de.skuzzle.inject.async.internal;

import static org.mockito.Mockito.mock;

import org.junit.Test;

import de.skuzzle.inject.async.ScheduledContext;
import de.skuzzle.inject.async.internal.context.ScheduledContextHolder;

public class DefaultExceptionHandlerTest {

    private final DefaultExceptionHandler subject = new DefaultExceptionHandler();

    @Test
    public void testHandleWithContext() throws Exception {
        ScheduledContextHolder.push(mock(ScheduledContext.class));
        this.subject.onException(new Exception());
    }

    @Test
    public void testHandleWithoutContext() throws Exception {
        this.subject.onException(new Exception());
    }
}

@@ -77,16 +77,41 @@
 .mock;%0A%0A
+import org.junit.Before;%0A
 import o
@@ -376,16 +376,169 @@
 ler();%0A%0A
+    @Before%0A    public void setup() %7B%0A        if (ScheduledContextHolder.isContextActive()) %7B%0A            ScheduledContextHolder.pop();%0A        %7D%0A    %7D%0A%0A
     @Tes

Improve test