@Test
public void testPerformOperation() {

    Object[] expectedArgs = new Object[0];
    Object expectedResource = new Object();
    when(operationFactoryMock.createRecordingOperation(expectedResource, "some method"))
            .thenReturn(operationRecorderMock);
    when(operationRecorderMock.recordOperation(expectedArgs)).thenReturn(operationExecutorMock);
    DefaultCompensatingTransactionOperationManager tested = new DefaultCompensatingTransactionOperationManager(
            operationFactoryMock);
    tested.performOperation(expectedResource, "some method", expectedArgs);
    verify(operationExecutorMock).performOperation();
    Stack result = tested.getOperationExecutors();
    assertThat(result.isEmpty()).isFalse();
    assertThat(result.peek()).isSameAs(operationExecutorMock);
}