package com.braintree.actions.order;

import de.hybris.bootstrap.annotations.UnitTest;
import de.hybris.platform.orderprocessing.events.OrderPlacedEvent;
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.verify;

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

    @InjectMocks
    private BrainTreeSendOrderPlacedNotificationAction sendOrderPlacedNotificationAction;

    @Mock
    private EventService eventService;

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

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

}
