Skip to content

Commit

Permalink
add test for checking dispatcher creation when transactions are not e…
Browse files Browse the repository at this point in the history
…nabled
  • Loading branch information
Edvard Fonsell committed Nov 11, 2014
1 parent b27ea0a commit d055e42
Showing 1 changed file with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
import org.mockito.invocation.InvocationOnMock;
import org.mockito.runners.MockitoJUnitRunner;
import org.mockito.stubbing.Answer;
import org.springframework.beans.factory.BeanCreationException;
import org.springframework.core.env.Environment;
import org.springframework.scheduling.concurrent.CustomizableThreadFactory;
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
Expand Down Expand Up @@ -54,6 +55,12 @@ public void setup() {
dispatcher = new WorkflowDispatcher(pool, workflowInstances, executorFactory, recovery, env);
}

@Test(expected = BeanCreationException.class)
public void workflowDispatcherCreationFailsWithoutTransactionSupport() {
when(recovery.isTransactionSupportEnabled()).thenReturn(false);
new WorkflowDispatcher(pool, workflowInstances, executorFactory, recovery, env);
}

@Test
public void exceptionDuringDispatcherExecutionCausesRetry() throws Throwable {
@SuppressWarnings("unused")
Expand Down

0 comments on commit d055e42

Please sign in to comment.