package com.braintree.actions.order;

import de.hybris.bootstrap.annotations.UnitTest;
import de.hybris.platform.orderprocessing.events.OrderCompletedEvent;
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.Mockito;
import org.mockito.runners.MockitoJUnitRunner;

import static org.mockito.Matchers.any;


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

    @InjectMocks
    private BrainTreeSendOrderCompletedNotificationAction sendOrderCompletedNotification;

    @Mock
    private EventService eventService;

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

        Mockito.verify(eventService).publishEvent(any(OrderCompletedEvent.class));
    }


}
