@Test
public void testRun() throws Exception {

    Execution execution = new Execution();
    when(converter.extractExecution(any(Payload.class))).thenReturn(execution);
    final List<ExecutionMessage> buffer = new ArrayList<>();
    doAnswer(invocation -> {
        for (Object message : invocation.getArguments()) {
            buffer.add((ExecutionMessage) message);
        }
        return null;
    }).when(outBuffer).put(any(ExecutionMessage[].class));
    when(workerManager.isFromCurrentThreadPool(anyString())).thenReturn(true);
    SimpleExecutionRunnable simpleExecutionRunnable = new SimpleExecutionRunnable(executionService, outBuffer,
            inBuffer, converter, endExecutionCallback, queueStateIdGenerator, "stam", workerConfigurationService,
            workerManager);
    ExecutionMessage executionMessage = new ExecutionMessage();
    executionMessage.setMsgId(String.valueOf(100L));
    simpleExecutionRunnable.setExecutionMessage(executionMessage);
    simpleExecutionRunnable.run();
    verify(executionService, times(1)).execute(execution);
    Assert.assertFalse(buffer.isEmpty());
    assertEquals(ExecStatus.FINISHED, buffer.get(0).getStatus());
    assertEquals(ExecStatus.FINISHED, buffer.get(0).getStatus());
    assertEquals(0, this.executionMessage.getMsgSeqId());
}