package com.braintree.actions.order;

import de.hybris.bootstrap.annotations.UnitTest;
import de.hybris.platform.orderprocessing.events.FraudErrorEvent;
import de.hybris.platform.orderprocessing.model.OrderProcessModel;
import de.hybris.platform.servicelayer.event.EventService;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.InjectMocks;
import org.mockito.Mock;
import org.mockito.runners.MockitoJUnitRunner;

import static org.mockito.Matchers.any;
import static org.mockito.Mockito.*;


@UnitTest
@RunWith(MockitoJUnitRunner.class)
public class BrainTreeSendFraudErrorNotificationActionTest {

    @Mock
    private EventService eventService;

    @InjectMocks
    private BrainTreeSendFraudErrorNotificationAction sendFraudErrorNotification;

    @Test
    public void testExecuteActionOrderProcessModel() {
        final OrderProcessModel process = new OrderProcessModel();
        sendFraudErrorNotification.executeAction(process);

        verify(eventService).publishEvent(any(FraudErrorEvent.class));
    }

}
